home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / Technical Documentation / develop / develop Issue 10 / develop Issue 10 code / Is it Art?.sea / Is it Art? / ArtMaker / PaintApp.c < prev    next >
MacBinary  |  1992-04-08  |  22.8 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
1% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Wed Apr 8 18:00:18 1992, modified Wed Apr 8 18:00:18 1992, creator Think C, type ASCII, 22199 bytes "PaintApp.c" magic text fragment for file(1) cmd, 1st line "#include⇥"Painterly.h"", 2nd line "", 3rd line "/* The one shell global we need */", 4th line "extern MenuHandle⇥gShellMenuHandles[];", 5th line "", at 0x5737 880 bytes resource magic text fragment for file(1) cmd, 1st line "#include⇥"Painterly.h"", 2nd line "", 3rd line "/* The one shell global we need */", 4th line "extern MenuHandle⇥gShellMenuHandles[];", 5th line "" default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% dearkID deark: macbinary default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 50 61 69 6e 74 41 | 70 70 2e 63 00 00 00 00 |..PaintA|pp.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 56 b7 00 | 00 03 70 a6 09 1d 72 a6 |.....V..|..p...r.|
|00000060| 09 1d 72 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..r.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 01 be 00 00 |........|........|
|00000080| 23 69 6e 63 6c 75 64 65 | 09 22 50 61 69 6e 74 65 |#include|."Painte|
|00000090| 72 6c 79 2e 68 22 0d 0d | 2f 2a 20 54 68 65 20 6f |rly.h"..|/* The o|
|000000a0| 6e 65 20 73 68 65 6c 6c | 20 67 6c 6f 62 61 6c 20 |ne shell| global |
|000000b0| 77 65 20 6e 65 65 64 20 | 2a 2f 0d 65 78 74 65 72 |we need |*/.exter|
|000000c0| 6e 20 4d 65 6e 75 48 61 | 6e 64 6c 65 09 67 53 68 |n MenuHa|ndle.gSh|
|000000d0| 65 6c 6c 4d 65 6e 75 48 | 61 6e 64 6c 65 73 5b 5d |ellMenuH|andles[]|
|000000e0| 3b 0d 0d 2f 2a 20 50 61 | 69 6e 74 65 72 6c 79 20 |;../* Pa|interly |
|000000f0| 47 6c 6f 62 61 6c 73 20 | 2a 2f 0d 4d 65 6e 75 48 |Globals |*/.MenuH|
|00000100| 61 6e 64 6c 65 09 09 67 | 50 61 69 6e 74 4d 65 6e |andle..g|PaintMen|
|00000110| 75 48 61 6e 64 6c 65 73 | 5b 6b 4e 75 6d 50 61 69 |uHandles|[kNumPai|
|00000120| 6e 74 4d 65 6e 75 73 5d | 3b 20 09 2f 2a 20 54 68 |ntMenus]|; ./* Th|
|00000130| 65 20 6d 65 6e 75 73 20 | 77 65 20 61 64 64 20 74 |e menus |we add t|
|00000140| 6f 20 74 68 65 20 73 68 | 65 6c 6c 20 2a 2f 0d 44 |o the sh|ell */.D|
|00000150| 6f 63 75 6d 65 6e 74 52 | 65 63 6f 72 64 09 67 53 |ocumentR|ecord.gS|
|00000160| 72 63 44 6f 63 2c 20 67 | 44 73 74 44 6f 63 3b 09 |rcDoc, g|DstDoc;.|
|00000170| 09 09 09 09 2f 2a 20 54 | 68 65 20 64 6f 63 20 72 |..../* T|he doc r|
|00000180| 65 63 6f 72 64 73 20 2a | 2f 0d 43 57 69 6e 64 6f |ecords *|/.CWindo|
|00000190| 77 50 74 72 09 09 67 53 | 72 63 57 69 6e 64 50 74 |wPtr..gS|rcWindPt|
|000001a0| 72 2c 20 67 44 73 74 57 | 69 6e 64 50 74 72 3b 09 |r, gDstW|indPtr;.|
|000001b0| 2f 2a 20 70 6f 69 6e 74 | 65 72 73 20 74 6f 20 74 |/* point|ers to t|
|000001c0| 68 65 20 77 69 6e 64 6f | 77 73 2c 20 66 6f 72 20 |he windo|ws, for |
|000001d0| 63 6f 6e 76 65 6e 69 65 | 6e 63 65 20 2a 2f 0d 43 |convenie|nce */.C|
|000001e0| 57 69 6e 64 6f 77 50 74 | 72 09 09 67 55 6e 64 6f |WindowPt|r..gUndo|
|000001f0| 54 61 72 67 65 74 20 3d | 20 6e 69 6c 3b 09 2f 2a |Target =| nil;./*|
|00000200| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 74 68 65 20 | pointer| to the |
|00000210| 77 69 6e 64 6f 77 20 77 | 68 65 72 65 20 74 68 65 |window w|here the|
|00000220| 20 6c 61 73 74 20 75 6e | 64 6f 20 6f 70 65 72 61 | last un|do opera|
|00000230| 74 69 6f 6e 20 68 61 70 | 70 65 6e 65 64 20 2a 2f |tion hap|pened */|
|00000240| 0d 47 57 6f 72 6c 64 50 | 74 72 09 09 67 55 6e 64 |.GWorldP|tr..gUnd|
|00000250| 6f 42 75 66 66 65 72 3b | 09 09 09 09 2f 2a 20 61 |oBuffer;|..../* a|
|00000260| 20 62 75 66 66 65 72 20 | 74 6f 20 61 6c 6c 6f 77 | buffer |to allow|
|00000270| 20 75 6e 64 6f 20 2a 2f | 0d 48 61 6e 64 6c 65 09 | undo */|.Handle.|
|00000280| 09 09 67 43 75 72 72 65 | 6e 74 42 72 75 73 68 48 |..gCurre|ntBrushH|
|00000290| 61 6e 64 6c 65 20 3d 20 | 6e 69 6c 3b 09 2f 2a 20 |andle = |nil;./* |
|000002a0| 68 61 6e 64 6c 65 20 74 | 6f 20 74 68 65 20 63 75 |handle t|o the cu|
|000002b0| 72 72 65 6e 74 20 42 72 | 75 73 68 20 63 6f 64 65 |rrent Br|ush code|
|000002c0| 20 2a 2f 0d 73 68 6f 72 | 74 09 09 09 67 43 75 72 | */.shor|t...gCur|
|000002d0| 72 65 6e 74 42 72 75 73 | 68 4e 75 6d 3b 09 09 09 |rentBrus|hNum;...|
|000002e0| 2f 2a 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 42 |/* the c|urrent B|
|000002f0| 72 75 73 68 20 6d 65 6e | 75 20 69 74 65 6d 20 2a |rush men|u item *|
|00000300| 2f 0d 42 72 75 73 68 50 | 61 72 61 6d 73 09 09 67 |/.BrushP|arams..g|
|00000310| 42 72 75 73 68 53 74 75 | 66 66 3b 09 09 09 09 2f |BrushStu|ff;..../|
|00000320| 2a 20 74 68 65 20 70 61 | 72 61 6d 65 74 65 72 20 |* the pa|rameter |
|00000330| 73 74 72 75 63 74 75 72 | 65 20 66 6f 72 20 62 72 |structur|e for br|
|00000340| 75 73 68 20 63 61 6c 6c | 73 20 2a 2f 0d 50 6f 69 |ush call|s */.Poi|
|00000350| 6e 74 09 09 09 67 4e 65 | 78 74 50 6f 69 6e 74 20 |nt...gNe|xtPoint |
|00000360| 3d 20 7b 30 2c 20 30 7d | 3b 09 09 2f 2a 20 74 68 |= {0, 0}|;../* th|
|00000370| 65 20 6e 65 78 74 20 70 | 6f 69 6e 74 20 74 6f 75 |e next p|oint tou|
|00000380| 63 68 65 64 20 69 6e 20 | 6f 72 64 65 72 65 64 20 |ched in |ordered |
|00000390| 73 74 72 6f 6b 65 73 20 | 2a 2f 0d 73 68 6f 72 74 |strokes |*/.short|
|000003a0| 09 09 09 67 4f 72 64 65 | 72 65 64 49 6e 63 72 65 |...gOrde|redIncre|
|000003b0| 6d 65 6e 74 20 3d 20 31 | 36 3b 09 09 2f 2a 20 74 |ment = 1|6;../* t|
|000003c0| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 70 69 78 |he numbe|r of pix|
|000003d0| 65 6c 73 20 74 6f 20 73 | 6b 69 70 20 69 6e 20 6f |els to s|kip in o|
|000003e0| 72 64 65 72 65 64 20 73 | 74 72 6f 6b 65 73 20 2a |rdered s|trokes *|
|000003f0| 2f 0d 42 6f 6f 6c 65 61 | 6e 09 09 09 67 50 61 69 |/.Boolea|n...gPai|
|00000400| 6e 74 69 6e 67 4e 6f 77 | 20 3d 20 66 61 6c 73 65 |ntingNow| = false|
|00000410| 2c 20 67 52 61 6e 64 6f | 6d 53 74 72 6f 6b 65 73 |, gRando|mStrokes|
|00000420| 20 3d 20 74 72 75 65 3b | 20 2f 2a 20 53 74 61 74 | = true;| /* Stat|
|00000430| 65 20 42 6f 6f 6c 65 61 | 6e 73 20 2a 2f 0d 54 48 |e Boolea|ns */.TH|
|00000440| 50 72 69 6e 74 09 09 09 | 67 50 72 69 6e 74 52 65 |Print...|gPrintRe|
|00000450| 63 48 61 6e 64 6c 65 3b | 09 09 09 2f 2a 20 54 68 |cHandle;|.../* Th|
|00000460| 65 20 70 72 69 6e 74 20 | 72 65 63 6f 72 64 20 2a |e print |record *|
|00000470| 2f 0d 52 47 42 43 6f 6c | 6f 72 09 09 67 42 47 43 |/.RGBCol|or..gBGC|
|00000480| 6f 6c 6f 72 20 3d 20 7b | 33 32 37 36 37 2c 20 33 |olor = {|32767, 3|
|00000490| 32 37 36 37 2c 20 33 32 | 37 36 37 7d 3b 20 2f 2a |2767, 32|767}; /*|
|000004a0| 20 54 68 65 20 62 67 20 | 63 6f 6c 6f 72 20 6f 66 | The bg |color of|
|000004b0| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination|
|000004c0| 20 77 69 6e 64 6f 77 20 | 2a 2f 0d 73 68 6f 72 74 | window |*/.short|
|000004d0| 09 09 09 67 44 6f 63 54 | 69 74 6c 65 48 65 69 67 |...gDocT|itleHeig|
|000004e0| 68 74 2c 20 67 44 6f 63 | 46 72 61 6d 65 57 69 64 |ht, gDoc|FrameWid|
|000004f0| 74 68 3b 20 2f 2a 20 57 | 69 6e 64 6f 77 20 53 74 |th; /* W|indow St|
|00000500| 61 74 73 2c 20 66 6f 72 | 20 75 73 65 20 69 6e 20 |ats, for| use in |
|00000510| 70 6f 73 69 74 69 6f 6e | 69 6e 67 0d 09 09 09 09 |position|ing.....|
|00000520| 09 09 09 09 09 09 09 09 | 09 61 6e 64 20 67 72 6f |........|.and gro|
|00000530| 77 69 6e 67 20 74 68 65 | 20 77 69 6e 64 6f 77 73 |wing the| windows|
|00000540| 20 2a 2f 0d 0d 2f 2a 20 | 43 61 6c 6c 65 64 20 62 | */../* |Called b|
|00000550| 79 20 74 68 65 20 53 68 | 65 6c 6c 20 61 74 20 73 |y the Sh|ell at s|
|00000560| 74 61 72 74 75 70 20 74 | 69 6d 65 20 2a 2f 0d 42 |tartup t|ime */.B|
|00000570| 6f 6f 6c 65 61 6e 20 41 | 70 70 49 6e 69 74 28 76 |oolean A|ppInit(v|
|00000580| 6f 69 64 29 0d 7b 0d 09 | 2f 2a 20 49 6e 69 74 20 |oid).{..|/* Init |
|00000590| 6f 6e 6c 79 20 68 61 70 | 70 65 6e 73 20 6f 6e 63 |only hap|pens onc|
|000005a0| 65 2c 20 73 6f 20 49 20 | 70 75 74 20 74 68 69 73 |e, so I |put this|
|000005b0| 20 72 6f 75 74 69 6e 65 | 20 69 6e 20 61 20 73 65 | routine| in a se|
|000005c0| 70 61 72 61 74 65 20 73 | 65 67 6d 65 6e 74 20 2a |parate s|egment *|
|000005d0| 2f 0d 09 72 65 74 75 72 | 6e 20 50 61 69 6e 74 49 |/..retur|n PaintI|
|000005e0| 6e 69 74 28 29 3b 09 0d | 7d 0d 0d 2f 2a 20 43 61 |nit();..|}../* Ca|
|000005f0| 6c 6c 65 64 20 77 68 65 | 6e 20 74 68 65 20 73 68 |lled whe|n the sh|
|00000600| 65 6c 6c 20 72 65 63 65 | 69 76 65 73 20 61 6e 20 |ell rece|ives an |
|00000610| 41 63 74 69 76 61 74 65 | 20 65 76 65 6e 74 2e 20 |Activate| event. |
|00000620| 49 74 20 6a 75 73 74 20 | 68 69 64 65 73 20 74 68 |It just |hides th|
|00000630| 65 20 73 63 72 6f 6c 6c | 62 61 72 73 20 61 6e 64 |e scroll|bars and|
|00000640| 0d 74 68 65 20 67 72 6f | 77 20 62 6f 78 20 6f 6e |.the gro|w box on|
|00000650| 20 64 65 2d 61 63 74 69 | 76 61 74 65 2c 20 6f 72 | de-acti|vate, or|
|00000660| 20 73 68 6f 77 73 20 74 | 68 65 6d 20 6f 6e 20 61 | shows t|hem on a|
|00000670| 63 74 69 76 61 74 65 2e | 0d 0d 2a 2a 4e 6f 74 65 |ctivate.|..**Note|
|00000680| 3a 20 49 20 75 73 65 64 | 20 74 6f 20 64 6f 20 6c |: I used| to do l|
|00000690| 6f 74 73 20 6f 66 20 66 | 61 6e 63 79 20 73 74 75 |ots of f|ancy stu|
|000006a0| 66 66 20 68 65 72 65 2c | 20 6c 69 6b 65 20 63 61 |ff here,| like ca|
|000006b0| 6c 6c 69 6e 67 20 56 61 | 6c 69 64 52 65 63 74 20 |lling Va|lidRect |
|000006c0| 6f 6e 20 74 68 65 20 63 | 6f 6e 74 72 6f 6c 20 0d |on the c|ontrol .|
|000006d0| 72 65 63 74 73 20 74 6f | 20 61 76 6f 69 64 20 72 |rects to| avoid r|
|000006e0| 65 64 72 61 77 69 6e 67 | 20 69 6e 20 74 68 65 20 |edrawing| in the |
|000006f0| 41 70 70 55 70 64 61 74 | 65 20 72 6f 75 74 69 6e |AppUpdat|e routin|
|00000700| 65 2c 20 62 75 74 20 49 | 20 6a 75 73 74 20 67 6f |e, but I| just go|
|00000710| 74 20 69 6e 20 74 72 6f | 75 62 6c 65 2e 20 54 68 |t in tro|uble. Th|
|00000720| 69 73 20 69 73 20 0d 65 | 61 73 69 65 72 2c 20 69 |is is .e|asier, i|
|00000730| 66 20 6e 6f 74 20 71 75 | 69 74 65 20 61 73 20 65 |f not qu|ite as e|
|00000740| 66 66 69 63 69 65 6e 74 | 2c 20 61 6e 64 20 63 6f |fficient|, and co|
|00000750| 73 6d 65 74 69 63 61 6c | 6c 79 20 69 74 27 73 20 |smetical|ly it's |
|00000760| 66 69 6e 65 20 28 79 6f | 75 20 63 61 6e 27 74 20 |fine (yo|u can't |
|00000770| 74 65 6c 6c 20 69 66 20 | 74 68 65 20 0d 73 63 72 |tell if |the .scr|
|00000780| 6f 6c 6c 62 61 72 20 67 | 65 74 73 20 64 72 61 77 |ollbar g|ets draw|
|00000790| 6e 20 74 77 69 63 65 20 | 62 79 20 6c 6f 6f 6b 69 |n twice |by looki|
|000007a0| 6e 67 20 61 74 20 69 74 | 29 2e 20 2a 2f 0d 0d 76 |ng at it|). */..v|
|000007b0| 6f 69 64 20 41 70 70 41 | 63 74 69 76 61 74 65 28 |oid AppA|ctivate(|
|000007c0| 57 69 6e 64 6f 77 50 74 | 72 20 77 69 6e 64 2c 20 |WindowPt|r wind, |
|000007d0| 42 6f 6f 6c 65 61 6e 20 | 61 63 74 69 76 61 74 65 |Boolean |activate|
|000007e0| 29 0d 7b 0d 09 44 6f 63 | 75 6d 65 6e 74 50 65 65 |).{..Doc|umentPee|
|000007f0| 6b 09 64 6f 63 3b 0d 09 | 0d 09 69 66 28 49 73 41 |k.doc;..|..if(IsA|
|00000800| 70 70 57 69 6e 64 6f 77 | 28 77 69 6e 64 29 20 3d |ppWindow|(wind) =|
|00000810| 3d 20 74 72 75 65 29 0d | 09 7b 0d 09 09 64 6f 63 |= true).|.{...doc|
|00000820| 20 3d 20 28 44 6f 63 75 | 6d 65 6e 74 50 65 65 6b | = (Docu|mentPeek|
|00000830| 29 77 69 6e 64 3b 0d 09 | 09 53 65 74 50 6f 72 74 |)wind;..|.SetPort|
|00000840| 28 77 69 6e 64 29 3b 0d | 09 09 69 66 28 61 63 74 |(wind);.|..if(act|
|00000850| 69 76 61 74 65 29 20 09 | 2f 2f 20 61 6e 20 61 63 |ivate) .|// an ac|
|00000860| 74 69 76 61 74 65 20 65 | 76 65 6e 74 0d 09 09 7b |tivate e|vent...{|
|00000870| 0d 09 09 09 0d 09 09 09 | 2f 2a 20 74 68 65 20 67 |........|/* the g|
|00000880| 72 6f 77 62 6f 78 20 61 | 6e 64 20 63 6f 6e 74 72 |rowbox a|nd contr|
|00000890| 6f 6c 73 20 6d 75 73 74 | 20 62 65 20 72 65 64 72 |ols must| be redr|
|000008a0| 61 77 6e 20 6f 6e 20 61 | 63 74 69 76 61 74 69 6f |awn on a|ctivatio|
|000008b0| 6e 2e 20 2a 2f 0d 09 09 | 09 44 72 61 77 47 72 6f |n. */...|.DrawGro|
|000008c0| 77 49 63 6f 6e 28 77 69 | 6e 64 29 3b 0d 09 09 09 |wIcon(wi|nd);....|
|000008d0| 53 68 6f 77 43 6f 6e 74 | 72 6f 6c 28 64 6f 63 2d |ShowCont|rol(doc-|
|000008e0| 3e 68 53 63 72 6f 6c 6c | 29 3b 0d 09 09 09 53 68 |>hScroll|);....Sh|
|000008f0| 6f 77 43 6f 6e 74 72 6f | 6c 28 64 6f 63 2d 3e 76 |owContro|l(doc->v|
|00000900| 53 63 72 6f 6c 6c 29 3b | 0d 09 09 7d 0d 09 09 65 |Scroll);|...}...e|
|00000910| 6c 73 65 09 09 09 09 09 | 09 09 09 2f 2f 20 61 20 |lse.....|...// a |
|00000920| 64 65 61 63 74 69 76 61 | 74 65 20 65 76 65 6e 74 |deactiva|te event|
|00000930| 0d 09 09 7b 0d 09 09 09 | 2f 2a 20 74 68 65 20 67 |...{....|/* the g|
|00000940| 72 6f 77 62 6f 78 20 61 | 6e 64 20 63 6f 6e 74 72 |rowbox a|nd contr|
|00000950| 6f 6c 73 20 6d 75 73 74 | 20 62 65 20 72 65 64 72 |ols must| be redr|
|00000960| 61 77 6e 20 6f 6e 20 64 | 65 2d 61 63 74 69 76 61 |awn on d|e-activa|
|00000970| 74 69 6f 6e 2c 20 74 6f | 6f 2e 20 2a 2f 0d 09 09 |tion, to|o. */...|
|00000980| 09 48 69 64 65 43 6f 6e | 74 72 6f 6c 28 64 6f 63 |.HideCon|trol(doc|
|00000990| 2d 3e 68 53 63 72 6f 6c | 6c 29 3b 0d 09 09 09 48 |->hScrol|l);....H|
|000009a0| 69 64 65 43 6f 6e 74 72 | 6f 6c 28 64 6f 63 2d 3e |ideContr|ol(doc->|
|000009b0| 76 53 63 72 6f 6c 6c 29 | 3b 0d 09 09 09 44 72 61 |vScroll)|;....Dra|
|000009c0| 77 47 72 6f 77 49 63 6f | 6e 28 77 69 6e 64 29 3b |wGrowIco|n(wind);|
|000009d0| 0d 09 09 7d 0d 09 7d 0d | 7d 0d 0d 2f 2a 20 43 61 |...}..}.|}../* Ca|
|000009e0| 6c 6c 65 64 20 77 68 65 | 6e 20 61 20 77 69 6e 64 |lled whe|n a wind|
|000009f0| 6f 77 20 6e 65 65 64 73 | 20 75 70 64 61 74 69 6e |ow needs| updatin|
|00000a00| 67 2e 20 42 65 67 69 6e | 55 70 64 61 74 65 28 29 |g. Begin|Update()|
|00000a10| 20 68 61 73 20 61 6c 72 | 65 61 64 79 20 62 65 65 | has alr|eady bee|
|00000a20| 6e 20 63 61 6c 6c 65 64 | 2c 20 61 6e 64 20 74 68 |n called|, and th|
|00000a30| 65 20 0d 70 6f 72 74 20 | 69 73 20 73 65 74 20 74 |e .port |is set t|
|00000a40| 6f 20 74 68 65 20 61 70 | 70 72 6f 70 72 69 61 74 |o the ap|propriat|
|00000a50| 65 20 77 69 6e 64 6f 77 | 20 2a 2f 0d 76 6f 69 64 |e window| */.void|
|00000a60| 20 41 70 70 55 70 64 61 | 74 65 28 45 76 65 6e 74 | AppUpda|te(Event|
|00000a70| 52 65 63 6f 72 64 20 2a | 65 76 65 6e 74 29 0d 7b |Record *|event).{|
|00000a80| 0d 09 57 69 6e 64 6f 77 | 50 74 72 09 09 77 69 6e |..Window|Ptr..win|
|00000a90| 64 3b 0d 09 52 65 63 74 | 09 09 09 75 70 64 61 74 |d;..Rect|...updat|
|00000aa0| 65 52 65 63 74 3b 0d 09 | 0d 09 77 69 6e 64 20 3d |eRect;..|..wind =|
|00000ab0| 20 28 57 69 6e 64 6f 77 | 50 74 72 29 65 76 65 6e | (Window|Ptr)even|
|00000ac0| 74 2d 3e 6d 65 73 73 61 | 67 65 3b 0d 0d 09 2f 2a |t->messa|ge;.../*|
|00000ad0| 20 43 6c 6f 73 65 20 75 | 70 20 74 68 65 20 63 6c | Close u|p the cl|
|00000ae0| 69 70 20 74 6f 20 65 78 | 63 6c 75 64 65 20 74 68 |ip to ex|clude th|
|00000af0| 65 20 73 63 72 6f 6c 6c | 20 62 61 72 73 20 62 65 |e scroll| bars be|
|00000b00| 66 6f 72 65 20 64 72 61 | 77 69 6e 67 20 63 6f 6e |fore dra|wing con|
|00000b10| 74 65 6e 74 20 2a 2f 0d | 09 43 6c 6f 73 65 43 6c |tent */.|.CloseCl|
|00000b20| 69 70 28 77 69 6e 64 29 | 3b 0d 09 75 70 64 61 74 |ip(wind)|;..updat|
|00000b30| 65 52 65 63 74 20 3d 20 | 28 2a 77 69 6e 64 2d 3e |eRect = |(*wind->|
|00000b40| 63 6c 69 70 52 67 6e 29 | 2d 3e 72 67 6e 42 42 6f |clipRgn)|->rgnBBo|
|00000b50| 78 3b 0d 09 4f 66 66 54 | 6f 57 69 6e 64 6f 77 28 |x;..OffT|oWindow(|
|00000b60| 77 69 6e 64 2c 20 26 75 | 70 64 61 74 65 52 65 63 |wind, &u|pdateRec|
|00000b70| 74 29 3b 0d 09 0d 09 2f | 2a 20 52 65 73 65 74 20 |t);..../|* Reset |
|00000b80| 74 68 65 20 63 6c 69 70 | 20 2a 2f 0d 09 43 6c 69 |the clip| */..Cli|
|00000b90| 70 52 65 63 74 28 26 77 | 69 6e 64 2d 3e 70 6f 72 |pRect(&w|ind->por|
|00000ba0| 74 52 65 63 74 29 3b 0d | 0d 09 2f 2a 20 44 72 61 |tRect);.|../* Dra|
|00000bb0| 77 20 74 68 65 20 67 72 | 6f 77 62 6f 78 20 61 6e |w the gr|owbox an|
|00000bc0| 64 20 63 6f 6e 74 72 6f | 6c 73 20 2a 2f 09 0d 09 |d contro|ls */...|
|00000bd0| 44 72 61 77 47 72 6f 77 | 49 63 6f 6e 28 77 69 6e |DrawGrow|Icon(win|
|00000be0| 64 29 3b 0d 09 69 66 28 | 46 72 6f 6e 74 57 69 6e |d);..if(|FrontWin|
|00000bf0| 64 6f 77 28 29 20 3d 3d | 20 77 69 6e 64 29 0d 09 |dow() ==| wind)..|
|00000c00| 7b 0d 09 09 55 70 64 74 | 43 6f 6e 74 72 6f 6c 28 |{...Updt|Control(|
|00000c10| 77 69 6e 64 2c 20 77 69 | 6e 64 2d 3e 76 69 73 52 |wind, wi|nd->visR|
|00000c20| 67 6e 29 3b 0d 09 7d 0d | 09 0d 7d 0d 0d 2f 2a 20 |gn);..}.|..}../* |
|00000c30| 43 61 6c 6c 65 64 20 77 | 68 65 6e 20 74 68 65 20 |Called w|hen the |
|00000c40| 73 68 65 6c 6c 20 72 65 | 63 69 65 76 65 73 20 61 |shell re|cieves a|
|00000c50| 20 6e 75 6c 6c 20 65 76 | 65 6e 74 2e 20 48 65 72 | null ev|ent. Her|
|00000c60| 65 27 73 20 77 68 65 72 | 65 20 70 61 69 6e 74 69 |e's wher|e painti|
|00000c70| 6e 67 20 68 61 70 70 65 | 6e 73 20 69 66 20 41 75 |ng happe|ns if Au|
|00000c80| 74 6f 2d 0d 50 61 69 6e | 74 20 69 73 20 6f 6e 2e |to-.Pain|t is on.|
|00000c90| 20 2a 2f 0d 76 6f 69 64 | 20 41 70 70 49 64 6c 65 | */.void| AppIdle|
|00000ca0| 28 45 76 65 6e 74 52 65 | 63 6f 72 64 20 2a 45 76 |(EventRe|cord *Ev|
|00000cb0| 65 6e 74 29 0d 7b 0d 09 | 2f 2a 20 43 68 65 63 6b |ent).{..|/* Check|
|00000cc0| 20 69 66 20 77 65 20 61 | 72 65 20 70 61 69 6e 74 | if we a|re paint|
|00000cd0| 69 6e 67 20 2a 2f 0d 09 | 69 66 28 67 50 61 69 6e |ing */..|if(gPain|
|00000ce0| 74 69 6e 67 4e 6f 77 29 | 0d 09 7b 0d 09 09 52 65 |tingNow)|..{...Re|
|00000cf0| 63 74 09 6f 66 66 52 65 | 63 74 3b 0d 09 0d 09 09 |ct.offRe|ct;.....|
|00000d00| 2f 2a 20 47 65 74 20 74 | 68 65 20 72 65 63 74 20 |/* Get t|he rect |
|00000d10| 6f 66 20 74 68 65 20 64 | 65 73 74 69 6e 61 74 69 |of the d|estinati|
|00000d20| 6f 6e 20 2a 2f 0d 09 09 | 6f 66 66 52 65 63 74 20 |on */...|offRect |
|00000d30| 3d 20 67 44 73 74 44 6f | 63 2e 77 6f 72 6c 64 2d |= gDstDo|c.world-|
|00000d40| 3e 70 6f 72 74 52 65 63 | 74 3b 0d 0d 09 09 69 66 |>portRec|t;....if|
|00000d50| 28 67 52 61 6e 64 6f 6d | 53 74 72 6f 6b 65 73 29 |(gRandom|Strokes)|
|00000d60| 0d 09 09 7b 0d 09 09 09 | 50 6f 69 6e 74 09 70 74 |...{....|Point.pt|
|00000d70| 3b 0d 09 09 09 0d 09 09 | 09 2f 2a 20 47 65 74 20 |;.......|./* Get |
|00000d80| 61 20 52 61 6e 64 6f 6d | 20 70 6f 69 6e 74 20 69 |a Random| point i|
|00000d90| 6e 20 74 68 65 20 6f 66 | 66 52 65 63 74 20 2a 2f |n the of|fRect */|
|00000da0| 0d 09 09 09 70 74 2e 68 | 20 3d 20 61 62 73 28 52 |....pt.h| = abs(R|
|00000db0| 61 6e 64 6f 6d 28 29 20 | 25 20 28 6f 66 66 52 65 |andom() |% (offRe|
|00000dc0| 63 74 2e 72 69 67 68 74 | 20 2d 20 6f 66 66 52 65 |ct.right| - offRe|
|00000dd0| 63 74 2e 6c 65 66 74 29 | 29 3b 0d 09 09 09 70 74 |ct.left)|);....pt|
|00000de0| 2e 76 20 3d 20 61 62 73 | 28 52 61 6e 64 6f 6d 28 |.v = abs|(Random(|
|00000df0| 29 20 25 20 28 6f 66 66 | 52 65 63 74 2e 62 6f 74 |) % (off|Rect.bot|
|00000e00| 74 6f 6d 20 2d 20 6f 66 | 66 52 65 63 74 2e 74 6f |tom - of|fRect.to|
|00000e10| 70 29 29 3b 0d 0d 09 09 | 09 2f 2a 20 53 74 72 6f |p));....|./* Stro|
|00000e20| 6b 65 20 69 74 20 2a 2f | 0d 09 09 09 53 74 72 6f |ke it */|....Stro|
|00000e30| 6b 65 42 6f 74 68 28 70 | 74 29 3b 0d 09 09 7d 0d |keBoth(p|t);...}.|
|00000e40| 09 09 65 6c 73 65 09 2f | 2a 20 4f 72 64 65 72 65 |..else./|* Ordere|
|00000e50| 64 20 53 74 72 6f 6b 65 | 73 20 2a 2f 0d 09 09 7b |d Stroke|s */...{|
|00000e60| 0d 09 09 09 2f 2a 20 53 | 74 72 6f 6b 65 20 74 68 |..../* S|troke th|
|00000e70| 65 20 70 72 65 76 69 6f | 75 73 6c 79 20 73 61 76 |e previo|usly sav|
|00000e80| 65 64 20 6e 65 78 74 20 | 70 6f 69 6e 74 20 2a 2f |ed next |point */|
|00000e90| 0d 09 09 09 53 74 72 6f | 6b 65 42 6f 74 68 28 67 |....Stro|keBoth(g|
|00000ea0| 4e 65 78 74 50 6f 69 6e | 74 29 3b 0d 09 09 09 0d |NextPoin|t);.....|
|00000eb0| 09 09 09 2f 2a 20 49 6e | 63 72 65 6d 65 6e 74 20 |.../* In|crement |
|00000ec0| 74 68 65 20 70 6f 69 6e | 74 20 66 6f 72 20 6e 65 |the poin|t for ne|
|00000ed0| 78 74 20 74 69 6d 65 20 | 2a 2f 0d 09 09 09 67 4e |xt time |*/....gN|
|00000ee0| 65 78 74 50 6f 69 6e 74 | 2e 68 20 2b 3d 20 67 4f |extPoint|.h += gO|
|00000ef0| 72 64 65 72 65 64 49 6e | 63 72 65 6d 65 6e 74 3b |rderedIn|crement;|
|00000f00| 0d 09 09 09 0d 09 09 09 | 2f 2a 20 69 66 20 77 65 |........|/* if we|
|00000f10| 20 66 65 6c 6c 20 6f 66 | 66 20 74 68 65 20 72 69 | fell of|f the ri|
|00000f20| 67 68 74 20 65 64 67 65 | 2c 20 77 72 61 70 20 61 |ght edge|, wrap a|
|00000f30| 72 6f 75 6e 64 2e 20 49 | 66 20 77 65 27 72 65 20 |round. I|f we're |
|00000f40| 64 6f 6e 65 2c 20 73 74 | 6f 70 20 70 61 69 6e 74 |done, st|op paint|
|00000f50| 69 6e 67 20 2a 2f 0d 09 | 09 09 69 66 28 67 4e 65 |ing */..|..if(gNe|
|00000f60| 78 74 50 6f 69 6e 74 2e | 68 20 3e 3d 20 6f 66 66 |xtPoint.|h >= off|
|00000f70| 52 65 63 74 2e 72 69 67 | 68 74 29 0d 09 09 09 7b |Rect.rig|ht)....{|
|00000f80| 0d 09 09 09 09 67 4e 65 | 78 74 50 6f 69 6e 74 2e |.....gNe|xtPoint.|
|00000f90| 68 20 3d 20 30 3b 0d 09 | 09 09 09 67 4e 65 78 74 |h = 0;..|...gNext|
|00000fa0| 50 6f 69 6e 74 2e 76 20 | 2b 3d 20 67 4f 72 64 65 |Point.v |+= gOrde|
|00000fb0| 72 65 64 49 6e 63 72 65 | 6d 65 6e 74 3b 0d 09 09 |redIncre|ment;...|
|00000fc0| 09 09 69 66 28 67 4e 65 | 78 74 50 6f 69 6e 74 2e |..if(gNe|xtPoint.|
|00000fd0| 76 20 3e 3d 20 6f 66 66 | 52 65 63 74 2e 62 6f 74 |v >= off|Rect.bot|
|00000fe0| 74 6f 6d 29 20 2f 2a 20 | 4e 65 65 64 20 74 6f 20 |tom) /* |Need to |
|00000ff0| 73 74 6f 70 20 70 61 69 | 6e 74 69 6e 67 20 2a 2f |stop pai|nting */|
|00001000| 0d 09 09 09 09 09 44 6f | 50 61 69 6e 74 4d 65 6e |......Do|PaintMen|
|00001010| 75 28 69 53 74 61 72 74 | 50 61 69 6e 74 69 6e 67 |u(iStart|Painting|
|00001020| 29 3b 0d 09 09 09 7d 0d | 09 09 7d 0d 09 7d 0d 7d |);....}.|..}..}.}|
|00001030| 0d 0d 2f 2a 20 43 61 6c | 6c 65 64 20 77 68 65 6e |../* Cal|led when|
|00001040| 20 74 68 65 72 65 20 69 | 73 20 61 20 63 6c 69 63 | there i|s a clic|
|00001050| 6b 20 69 6e 20 74 68 65 | 20 63 6f 6e 74 65 6e 74 |k in the| content|
|00001060| 20 6f 66 20 61 20 77 69 | 6e 64 6f 77 2e 20 54 68 | of a wi|ndow. Th|
|00001070| 65 20 70 6f 72 74 20 69 | 73 20 61 6c 72 65 61 64 |e port i|s alread|
|00001080| 79 20 73 65 74 20 74 6f | 20 0d 74 68 65 20 77 69 |y set to| .the wi|
|00001090| 6e 64 6f 77 2c 20 61 6e | 64 20 74 68 65 50 74 20 |ndow, an|d thePt |
|000010a0| 69 73 20 69 6e 20 6c 6f | 63 61 6c 20 63 6f 6f 72 |is in lo|cal coor|
|000010b0| 64 73 2e 20 4d 61 6e 75 | 61 6c 20 70 61 69 6e 74 |ds. Manu|al paint|
|000010c0| 69 6e 67 20 68 61 70 70 | 65 6e 73 20 68 65 72 65 |ing happ|ens here|
|000010d0| 2c 20 61 73 20 64 6f 65 | 73 20 73 63 72 6f 6c 6c |, as doe|s scroll|
|000010e0| 0d 62 61 72 20 73 74 75 | 66 66 2e 20 2a 2f 0d 76 |.bar stu|ff. */.v|
|000010f0| 6f 69 64 20 41 70 70 43 | 6c 69 63 6b 28 50 6f 69 |oid AppC|lick(Poi|
|00001100| 6e 74 20 74 68 65 50 74 | 2c 20 57 69 6e 64 6f 77 |nt thePt|, Window|
|00001110| 50 74 72 20 77 68 69 63 | 68 57 69 6e 64 70 74 72 |Ptr whic|hWindptr|
|00001120| 2c 20 42 6f 6f 6c 65 61 | 6e 20 64 6f 75 62 6c 65 |, Boolea|n double|
|00001130| 43 6c 69 63 6b 29 0d 7b | 0d 09 69 66 28 49 73 41 |Click).{|..if(IsA|
|00001140| 70 70 57 69 6e 64 6f 77 | 28 77 68 69 63 68 57 69 |ppWindow|(whichWi|
|00001150| 6e 64 70 74 72 29 20 3d | 3d 20 74 72 75 65 29 0d |ndptr) =|= true).|
|00001160| 09 7b 0d 09 09 50 6f 69 | 6e 74 09 09 09 6c 61 73 |.{...Poi|nt...las|
|00001170| 74 50 6f 69 6e 74 20 3d | 20 7b 30 2c 20 30 7d 2c |tPoint =| {0, 0},|
|00001180| 20 6e 65 77 50 74 3b 0d | 09 09 73 68 6f 72 74 09 | newPt;.|..short.|
|00001190| 09 09 70 61 72 74 2c 20 | 76 61 6c 75 65 3b 0d 09 |..part, |value;..|
|000011a0| 09 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 09 63 |.Control|Handle.c|
|000011b0| 6f 6e 74 72 6f 6c 3b 0d | 09 09 44 6f 63 75 6d 65 |ontrol;.|..Docume|
|000011c0| 6e 74 50 65 65 6b 09 64 | 6f 63 3b 0d 0d 09 09 2f |ntPeek.d|oc;..../|
|000011d0| 2a 20 47 65 74 20 74 68 | 65 20 64 6f 63 20 2a 2f |* Get th|e doc */|
|000011e0| 0d 09 09 64 6f 63 20 3d | 20 28 44 6f 63 75 6d 65 |...doc =| (Docume|
|000011f0| 6e 74 50 65 65 6b 29 77 | 68 69 63 68 57 69 6e 64 |ntPeek)w|hichWind|
|00001200| 70 74 72 3b 0d 09 09 0d | 09 09 2f 2a 20 46 69 72 |ptr;....|../* Fir|
|00001210| 73 74 20 66 69 6e 64 20 | 6f 75 74 20 69 66 20 74 |st find |out if t|
|00001220| 68 65 20 63 6c 69 63 6b | 20 69 73 20 69 6e 20 61 |he click| is in a|
|00001230| 20 73 63 72 6f 6c 6c 62 | 61 72 3a 20 69 66 20 73 | scrollb|ar: if s|
|00001240| 6f 20 64 65 61 6c 20 77 | 69 74 68 20 69 74 20 2a |o deal w|ith it *|
|00001250| 2f 0d 09 09 70 61 72 74 | 20 3d 20 46 69 6e 64 43 |/...part| = FindC|
|00001260| 6f 6e 74 72 6f 6c 28 74 | 68 65 50 74 2c 20 77 68 |ontrol(t|hePt, wh|
|00001270| 69 63 68 57 69 6e 64 70 | 74 72 2c 20 26 63 6f 6e |ichWindp|tr, &con|
|00001280| 74 72 6f 6c 29 3b 0d 09 | 09 69 66 28 70 61 72 74 |trol);..|.if(part|
|00001290| 20 21 3d 20 30 29 0d 09 | 09 7b 0d 09 09 09 73 77 | != 0)..|.{....sw|
|000012a0| 69 74 63 68 20 28 20 70 | 61 72 74 20 29 0d 09 09 |itch ( p|art )...|
|000012b0| 09 7b 0d 09 09 09 09 2f | 2a 20 54 68 65 20 74 68 |.{...../|* The th|
|000012c0| 75 6d 62 20 69 73 20 73 | 70 65 63 69 61 6c 2c 20 |umb is s|pecial, |
|000012d0| 61 6e 64 20 64 6f 65 73 | 6e 27 74 20 75 73 65 20 |and does|n't use |
|000012e0| 74 68 65 20 41 63 74 69 | 6f 6e 20 50 72 6f 63 20 |the Acti|on Proc |
|000012f0| 2a 2f 0d 09 09 09 09 63 | 61 73 65 20 69 6e 54 68 |*/.....c|ase inTh|
|00001300| 75 6d 62 3a 20 0d 09 09 | 09 09 09 76 61 6c 75 65 |umb: ...|...value|
|00001310| 20 3d 20 47 65 74 43 74 | 6c 56 61 6c 75 65 28 63 | = GetCt|lValue(c|
|00001320| 6f 6e 74 72 6f 6c 29 3b | 0d 09 09 09 09 09 70 61 |ontrol);|......pa|
|00001330| 72 74 20 3d 20 54 72 61 | 63 6b 43 6f 6e 74 72 6f |rt = Tra|ckContro|
|00001340| 6c 28 63 6f 6e 74 72 6f | 6c 2c 20 74 68 65 50 74 |l(contro|l, thePt|
|00001350| 2c 20 6e 69 6c 29 3b 0d | 09 09 09 09 09 69 66 20 |, nil);.|.....if |
|00001360| 28 20 70 61 72 74 20 21 | 3d 20 30 20 29 20 2f 2a |( part !|= 0 ) /*|
|00001370| 20 47 6f 6f 64 20 63 6f | 6e 74 72 6f 6c 20 68 69 | Good co|ntrol hi|
|00001380| 74 20 2a 2f 0d 09 09 09 | 09 09 7b 20 0d 09 09 09 |t */....|..{ ....|
|00001390| 09 09 09 76 61 6c 75 65 | 20 2d 3d 20 47 65 74 43 |...value| -= GetC|
|000013a0| 74 6c 56 61 6c 75 65 28 | 63 6f 6e 74 72 6f 6c 29 |tlValue(|control)|
|000013b0| 3b 0d 09 09 09 09 09 09 | 2f 2a 20 76 61 6c 75 65 |;.......|/* value|
|000013c0| 20 6e 6f 77 20 68 61 73 | 20 43 48 41 4e 47 45 20 | now has| CHANGE |
|000013d0| 69 6e 20 76 61 6c 75 65 | 3b 20 69 66 20 76 61 6c |in value|; if val|
|000013e0| 75 65 20 63 68 61 6e 67 | 65 64 2c 20 73 63 72 6f |ue chang|ed, scro|
|000013f0| 6c 6c 20 2a 2f 0d 09 09 | 09 09 09 09 69 66 20 28 |ll */...|....if (|
|00001400| 20 76 61 6c 75 65 20 21 | 3d 20 30 20 29 0d 09 09 | value !|= 0 )...|
|00001410| 09 09 09 09 09 69 66 20 | 28 20 63 6f 6e 74 72 6f |.....if |( contro|
|00001420| 6c 20 3d 3d 20 64 6f 63 | 2d 3e 76 53 63 72 6f 6c |l == doc|->vScrol|
|00001430| 6c 20 29 0d 09 09 09 09 | 09 09 09 09 53 63 72 6f |l ).....|....Scro|
|00001440| 6c 6c 50 69 63 74 28 30 | 2c 20 76 61 6c 75 65 2c |llPict(0|, value,|
|00001450| 20 77 68 69 63 68 57 69 | 6e 64 70 74 72 29 3b 0d | whichWi|ndptr);.|
|00001460| 09 09 09 09 09 09 09 65 | 6c 73 65 0d 09 09 09 09 |.......e|lse.....|
|00001470| 09 09 09 09 53 63 72 6f | 6c 6c 50 69 63 74 28 76 |....Scro|llPict(v|
|00001480| 61 6c 75 65 2c 20 30 2c | 20 77 68 69 63 68 57 69 |alue, 0,| whichWi|
|00001490| 6e 64 70 74 72 29 3b 0d | 09 09 09 09 09 7d 0d 09 |ndptr);.|.....}..|
|000014a0| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 09 09 |....brea|k;......|
|000014b0| 0d 09 09 09 09 64 65 66 | 61 75 6c 74 3a 09 2f 2a |.....def|ault:./*|
|000014c0| 20 74 68 65 79 20 63 6c | 69 63 6b 65 64 20 69 6e | they cl|icked in|
|000014d0| 20 61 6e 20 61 72 72 6f | 77 2c 20 73 6f 20 74 72 | an arro|w, so tr|
|000014e0| 61 63 6b 20 26 20 73 63 | 72 6f 6c 6c 20 2a 2f 0d |ack & sc|roll */.|
|000014f0| 09 09 09 09 09 76 61 6c | 75 65 20 3d 20 54 72 61 |.....val|ue = Tra|
|00001500| 63 6b 43 6f 6e 74 72 6f | 6c 28 63 6f 6e 74 72 6f |ckContro|l(contro|
|00001510| 6c 2c 20 74 68 65 50 74 | 2c 20 28 50 72 6f 63 50 |l, thePt|, (ProcP|
|00001520| 74 72 29 20 53 63 72 6f | 6c 6c 41 63 74 69 6f 6e |tr) Scro|llAction|
|00001530| 50 72 6f 63 29 3b 0d 09 | 09 09 09 09 62 72 65 61 |Proc);..|....brea|
|00001540| 6b 3b 0d 09 09 09 7d 0d | 09 09 7d 0d 09 09 65 6c |k;....}.|..}...el|
|00001550| 73 65 09 2f 2a 20 4e 6f | 74 20 61 20 63 6f 6e 74 |se./* No|t a cont|
|00001560| 72 6f 6c 20 63 6c 69 63 | 6b 3a 20 50 61 69 6e 74 |rol clic|k: Paint|
|00001570| 20 69 6e 73 74 65 61 64 | 20 2a 2f 0d 09 09 7b 0d | instead| */...{.|
|00001580| 09 09 09 2f 2a 20 41 6c | 6c 6f 77 20 61 6e 20 55 |.../* Al|low an U|
|00001590| 6e 64 6f 20 2a 2f 0d 09 | 09 09 53 65 74 55 70 46 |ndo */..|..SetUpF|
|000015a0| 6f 72 55 6e 64 6f 28 67 | 44 73 74 57 69 6e 64 50 |orUndo(g|DstWindP|
|000015b0| 74 72 29 3b 0d 09 09 09 | 0d 09 09 09 2f 2a 20 4b |tr);....|..../* K|
|000015c0| 65 65 70 20 70 61 69 6e | 74 69 6e 67 20 77 68 69 |eep pain|ting whi|
|000015d0| 6c 65 20 74 68 65 20 6d | 6f 75 73 65 20 69 73 20 |le the m|ouse is |
|000015e0| 64 6f 77 6e 20 2a 2f 0d | 09 09 09 77 68 69 6c 65 |down */.|...while|
|000015f0| 28 53 74 69 6c 6c 44 6f | 77 6e 28 29 29 0d 09 09 |(StillDo|wn())...|
|00001600| 09 7b 0d 09 09 09 09 2f | 2a 20 47 65 74 20 74 68 |.{...../|* Get th|
|00001610| 65 20 6d 6f 75 73 65 20 | 6c 6f 63 61 74 69 6f 6e |e mouse |location|
|00001620| 20 2a 2f 0d 09 09 09 09 | 53 65 74 50 6f 72 74 28 | */.....|SetPort(|
|00001630| 77 68 69 63 68 57 69 6e | 64 70 74 72 29 3b 0d 09 |whichWin|dptr);..|
|00001640| 09 09 09 47 65 74 4d 6f | 75 73 65 28 26 6e 65 77 |...GetMo|use(&new|
|00001650| 50 74 29 3b 0d 09 09 09 | 09 0d 09 09 09 09 2f 2a |Pt);....|....../*|
|00001660| 20 49 66 20 74 68 65 20 | 6d 6f 75 73 65 20 68 61 | If the |mouse ha|
|00001670| 73 6e 27 74 20 6d 6f 76 | 65 64 2c 20 64 6f 20 6e |sn't mov|ed, do n|
|00001680| 6f 74 68 69 6e 67 20 2a | 2f 0d 09 09 09 09 69 66 |othing *|/.....if|
|00001690| 28 6e 65 77 50 74 2e 68 | 20 3d 3d 20 6c 61 73 74 |(newPt.h| == last|
|000016a0| 50 6f 69 6e 74 2e 68 20 | 26 26 20 6e 65 77 50 74 |Point.h |&& newPt|
|000016b0| 2e 76 20 3d 3d 20 6c 61 | 73 74 50 6f 69 6e 74 2e |.v == la|stPoint.|
|000016c0| 76 29 0d 09 09 09 09 09 | 63 6f 6e 74 69 6e 75 65 |v)......|continue|
|000016d0| 3b 0d 09 09 09 09 0d 09 | 09 09 09 2f 2a 20 53 65 |;.......|.../* Se|
|000016e0| 74 20 6c 61 73 74 50 6f | 69 6e 74 20 66 6f 72 20 |t lastPo|int for |
|000016f0| 66 75 74 75 72 65 20 63 | 6f 6d 70 61 72 69 73 6f |future c|ompariso|
|00001700| 6e 20 2a 2f 0d 09 09 09 | 09 6c 61 73 74 50 6f 69 |n */....|.lastPoi|
|00001710| 6e 74 20 3d 20 6e 65 77 | 50 74 3b 0d 09 09 09 09 |nt = new|Pt;.....|
|00001720| 0d 09 09 09 09 2f 2a 20 | 52 61 6e 64 6f 6d 69 7a |...../* |Randomiz|
|00001730| 65 20 70 6f 69 6e 74 20 | 61 20 6c 69 74 74 6c 65 |e point |a little|
|00001740| 20 2a 2f 0d 09 09 09 09 | 6e 65 77 50 74 2e 68 20 | */.....|newPt.h |
|00001750| 2b 3d 20 52 61 6e 64 6f | 6d 28 29 20 25 20 38 3b |+= Rando|m() % 8;|
|00001760| 0d 09 09 09 09 6e 65 77 | 50 74 2e 76 20 2b 3d 20 |.....new|Pt.v += |
|00001770| 52 61 6e 64 6f 6d 28 29 | 20 25 20 38 3b 0d 09 09 |Random()| % 8;...|
|00001780| 09 09 0d 09 09 09 09 2f | 2a 20 49 66 20 74 68 65 |......./|* If the|
|00001790| 20 70 6f 69 6e 74 20 69 | 73 20 6f 75 74 73 69 64 | point i|s outsid|
|000017a0| 65 20 74 68 65 20 77 6f | 72 6c 64 20 6e 6f 77 2c |e the wo|rld now,|
|000017b0| 20 64 6f 20 6e 6f 74 68 | 69 6e 67 20 2a 2f 0d 09 | do noth|ing */..|
|000017c0| 09 09 09 69 66 28 21 50 | 74 49 6e 52 65 63 74 28 |...if(!P|tInRect(|
|000017d0| 6e 65 77 50 74 2c 20 26 | 64 6f 63 2d 3e 77 6f 72 |newPt, &|doc->wor|
|000017e0| 6c 64 2d 3e 70 6f 72 74 | 52 65 63 74 29 29 0d 09 |ld->port|Rect))..|
|000017f0| 09 09 09 09 63 6f 6e 74 | 69 6e 75 65 3b 0d 09 09 |....cont|inue;...|
|00001800| 09 09 0d 09 09 09 09 2f | 2a 20 53 74 72 6f 6b 65 |......./|* Stroke|
|00001810| 20 69 74 2e 20 4e 65 65 | 64 20 74 6f 20 63 6f 6e | it. Nee|d to con|
|00001820| 76 65 72 74 20 74 6f 20 | 47 57 6f 72 6c 64 20 63 |vert to |GWorld c|
|00001830| 6f 6f 72 64 73 20 66 69 | 72 73 74 2a 2f 0d 09 09 |oords fi|rst*/...|
|00001840| 09 09 6e 65 77 50 74 2e | 68 20 2b 3d 20 47 65 74 |..newPt.|h += Get|
|00001850| 43 74 6c 56 61 6c 75 65 | 28 64 6f 63 2d 3e 68 53 |CtlValue|(doc->hS|
|00001860| 63 72 6f 6c 6c 29 3b 0d | 09 09 09 09 6e 65 77 50 |croll);.|....newP|
|00001870| 74 2e 76 20 2b 3d 20 47 | 65 74 43 74 6c 56 61 6c |t.v += G|etCtlVal|
|00001880| 75 65 28 64 6f 63 2d 3e | 76 53 63 72 6f 6c 6c 29 |ue(doc->|vScroll)|
|00001890| 3b 0d 09 09 09 09 53 74 | 72 6f 6b 65 42 6f 74 68 |;.....St|rokeBoth|
|000018a0| 28 6e 65 77 50 74 29 3b | 0d 09 09 09 7d 0d 09 09 |(newPt);|....}...|
|000018b0| 7d 0d 09 7d 0d 7d 0d 0d | 2f 2a 20 43 61 6c 6c 65 |}..}.}..|/* Calle|
|000018c0| 64 20 77 68 65 6e 20 74 | 68 65 72 65 20 69 73 20 |d when t|here is |
|000018d0| 61 20 63 6c 69 63 6b 20 | 69 6e 20 74 68 65 20 67 |a click |in the g|
|000018e0| 72 6f 77 20 72 65 67 69 | 6f 6e 2e 20 4a 75 73 74 |row regi|on. Just|
|000018f0| 20 67 72 6f 77 73 20 74 | 68 65 20 77 69 6e 64 6f | grows t|he windo|
|00001900| 77 2c 20 77 69 74 68 20 | 74 68 65 20 0d 6d 61 78 |w, with |the .max|
|00001910| 69 6d 75 6d 20 73 69 7a | 65 20 73 65 74 20 74 6f |imum siz|e set to|
|00001920| 20 74 68 65 20 6f 66 66 | 73 63 72 65 65 6e 20 73 | the off|screen s|
|00001930| 69 7a 65 2e 20 2a 2f 0d | 76 6f 69 64 20 41 70 70 |ize. */.|void App|
|00001940| 47 72 6f 77 57 69 6e 64 | 6f 77 28 57 69 6e 64 6f |GrowWind|ow(Windo|
|00001950| 77 50 74 72 20 77 69 6e | 64 2c 20 50 6f 69 6e 74 |wPtr win|d, Point|
|00001960| 20 77 68 65 72 65 2c 20 | 52 65 63 74 20 2a 64 65 | where, |Rect *de|
|00001970| 73 6b 29 0d 7b 0d 09 52 | 65 63 74 09 09 09 6c 69 |sk).{..R|ect...li|
|00001980| 6d 69 74 73 3b 0d 09 44 | 6f 63 75 6d 65 6e 74 50 |mits;..D|ocumentP|
|00001990| 65 65 6b 09 64 6f 63 3b | 0d 09 47 57 6f 72 6c 64 |eek.doc;|..GWorld|
|000019a0| 50 74 72 09 09 77 6f 72 | 6c 64 3b 0d 09 6c 6f 6e |Ptr..wor|ld;..lon|
|000019b0| 67 09 09 09 73 69 7a 65 | 3b 0d 09 0d 09 2f 2a 20 |g...size|;..../* |
|000019c0| 44 6f 20 6e 6f 74 68 69 | 6e 67 20 69 66 20 6e 6f |Do nothi|ng if no|
|000019d0| 74 20 6f 75 72 20 77 69 | 6e 64 6f 77 20 2a 2f 0d |t our wi|ndow */.|
|000019e0| 09 69 66 28 49 73 41 70 | 70 57 69 6e 64 6f 77 28 |.if(IsAp|pWindow(|
|000019f0| 77 69 6e 64 29 20 3d 3d | 20 66 61 6c 73 65 29 0d |wind) ==| false).|
|00001a00| 09 09 72 65 74 75 72 6e | 3b 0d 09 09 0d 09 64 6f |..return|;.....do|
|00001a10| 63 20 3d 20 28 44 6f 63 | 75 6d 65 6e 74 50 65 65 |c = (Doc|umentPee|
|00001a20| 6b 29 77 69 6e 64 3b 0d | 09 77 6f 72 6c 64 20 3d |k)wind;.|.world =|
|00001a30| 20 64 6f 63 2d 3e 77 6f | 72 6c 64 3b 0d 09 0d 09 | doc->wo|rld;....|
|00001a40| 2f 2a 20 53 65 74 20 75 | 70 20 73 69 7a 65 20 6c |/* Set u|p size l|
|00001a50| 69 6d 69 74 73 20 2a 2f | 0d 09 6c 69 6d 69 74 73 |imits */|..limits|
|00001a60| 2e 74 6f 70 20 3d 20 6c | 69 6d 69 74 73 2e 6c 65 |.top = l|imits.le|
|00001a70| 66 74 20 3d 20 6b 4d 69 | 6e 57 69 6e 64 6f 77 53 |ft = kMi|nWindowS|
|00001a80| 69 7a 65 3b 20 2f 2a 20 | 4f 6e 65 20 69 6e 63 68 |ize; /* |One inch|
|00001a90| 20 6d 69 6e 69 6d 75 6d | 20 2a 2f 0d 09 2f 2a 20 | minimum| */../* |
|00001aa0| 54 68 65 73 65 20 61 72 | 65 20 61 63 74 75 61 6c |These ar|e actual|
|00001ab0| 6c 79 20 62 69 67 67 65 | 72 20 74 68 61 6e 20 74 |ly bigge|r than t|
|00001ac0| 68 65 20 6d 61 78 69 6d | 75 6d 20 73 69 7a 65 20 |he maxim|um size |
|00001ad0| 6f 66 20 74 68 65 20 70 | 6f 72 74 52 65 63 74 2c |of the p|ortRect,|
|00001ae0| 20 0d 09 73 69 6e 63 65 | 20 74 68 65 20 6f 75 74 | ..since| the out|
|00001af0| 6c 69 6e 65 20 64 72 61 | 67 67 65 64 20 62 79 20 |line dra|gged by |
|00001b00| 47 72 6f 77 57 69 6e 64 | 6f 77 20 69 73 20 74 68 |GrowWind|ow is th|
|00001b10| 65 20 6f 75 74 6c 69 6e | 65 20 6f 66 20 74 68 65 |e outlin|e of the|
|00001b20| 20 77 69 6e 64 6f 77 20 | 66 72 61 6d 65 2c 0d 09 | window |frame,..|
|00001b30| 6e 6f 74 20 69 74 73 20 | 70 6f 72 74 52 65 63 74 |not its |portRect|
|00001b40| 20 2a 2f 0d 09 6c 69 6d | 69 74 73 2e 72 69 67 68 | */..lim|its.righ|
|00001b50| 74 20 3d 20 77 6f 72 6c | 64 2d 3e 70 6f 72 74 52 |t = worl|d->portR|
|00001b60| 65 63 74 2e 72 69 67 68 | 74 20 2b 20 6b 53 63 72 |ect.righ|t + kScr|
|00001b70| 6f 6c 6c 41 64 6a 75 73 | 74 20 2b 20 67 44 6f 63 |ollAdjus|t + gDoc|
|00001b80| 46 72 61 6d 65 57 69 64 | 74 68 3b 0d 09 6c 69 6d |FrameWid|th;..lim|
|00001b90| 69 74 73 2e 62 6f 74 74 | 6f 6d 20 3d 20 77 6f 72 |its.bott|om = wor|
|00001ba0| 6c 64 2d 3e 70 6f 72 74 | 52 65 63 74 2e 62 6f 74 |ld->port|Rect.bot|
|00001bb0| 74 6f 6d 20 2b 20 6b 53 | 63 72 6f 6c 6c 41 64 6a |tom + kS|crollAdj|
|00001bc0| 75 73 74 20 2b 20 67 44 | 6f 63 46 72 61 6d 65 57 |ust + gD|ocFrameW|
|00001bd0| 69 64 74 68 3b 0d 09 0d | 09 2f 2a 20 4c 65 74 20 |idth;...|./* Let |
|00001be0| 74 68 65 20 75 73 65 72 | 20 67 72 6f 77 20 74 68 |the user| grow th|
|00001bf0| 65 20 77 69 6e 64 6f 77 | 20 2a 2f 0d 09 73 69 7a |e window| */..siz|
|00001c00| 65 20 3d 20 47 72 6f 77 | 57 69 6e 64 6f 77 28 77 |e = Grow|Window(w|
|00001c10| 69 6e 64 2c 20 77 68 65 | 72 65 2c 20 26 6c 69 6d |ind, whe|re, &lim|
|00001c20| 69 74 73 29 3b 0d 09 0d | 09 2f 2a 20 49 66 20 74 |its);...|./* If t|
|00001c30| 68 65 20 73 69 7a 65 20 | 63 68 61 6e 67 65 64 2c |he size |changed,|
|00001c40| 20 74 68 65 6e 20 65 72 | 61 73 65 20 74 68 65 20 | then er|ase the |
|00001c50| 73 63 72 6f 6c 6c 62 61 | 72 73 20 61 6e 64 20 67 |scrollba|rs and g|
|00001c60| 72 6f 77 20 62 6f 78 20 | 61 72 65 61 20 61 6e 64 |row box |area and|
|00001c70| 20 73 69 7a 65 20 74 68 | 65 20 0d 09 77 69 6e 64 | size th|e ..wind|
|00001c80| 6f 77 2c 20 61 64 6a 75 | 73 74 69 6e 67 20 74 68 |ow, adju|sting th|
|00001c90| 65 20 73 63 72 6f 6c 6c | 20 62 61 72 73 20 61 6e |e scroll| bars an|
|00001ca0| 64 20 73 6f 20 6f 6e 20 | 2a 2f 0d 09 69 66 28 73 |d so on |*/..if(s|
|00001cb0| 69 7a 65 20 21 3d 20 30 | 29 0d 09 7b 0d 09 09 52 |ize != 0|)..{...R|
|00001cc0| 65 63 74 09 74 65 6d 70 | 52 65 63 74 3b 0d 09 09 |ect.temp|Rect;...|
|00001cd0| 73 68 6f 72 74 09 68 53 | 69 7a 65 2c 20 76 53 69 |short.hS|ize, vSi|
|00001ce0| 7a 65 3b 0d 09 09 0d 09 | 09 53 65 74 50 6f 72 74 |ze;.....|.SetPort|
|00001cf0| 28 77 69 6e 64 29 3b 0d | 09 09 0d 09 09 2f 2a 20 |(wind);.|...../* |
|00001d00| 53 68 6f 75 6c 64 20 65 | 72 61 73 65 20 74 68 65 |Should e|rase the|
|00001d10| 20 73 63 72 6f 6c 6c 62 | 61 72 73 20 61 6e 64 20 | scrollb|ars and |
|00001d20| 67 72 6f 77 20 62 6f 78 | 20 61 72 65 61 20 62 65 |grow box| area be|
|00001d30| 66 6f 72 65 20 72 65 73 | 69 7a 69 6e 67 20 74 68 |fore res|izing th|
|00001d40| 65 20 77 69 6e 64 6f 77 | 3a 20 2a 2f 0d 09 09 0d |e window|: */....|
|00001d50| 09 09 2f 2a 20 6d 61 6b | 65 20 61 20 72 65 63 74 |../* mak|e a rect|
|00001d60| 20 66 6f 72 20 74 68 65 | 20 67 72 6f 77 42 6f 78 | for the| growBox|
|00001d70| 20 2a 2f 0d 09 09 74 65 | 6d 70 52 65 63 74 20 3d | */...te|mpRect =|
|00001d80| 20 77 69 6e 64 2d 3e 70 | 6f 72 74 52 65 63 74 3b | wind->p|ortRect;|
|00001d90| 0d 09 09 74 65 6d 70 52 | 65 63 74 2e 74 6f 70 20 |...tempR|ect.top |
|00001da0| 3d 20 74 65 6d 70 52 65 | 63 74 2e 62 6f 74 74 6f |= tempRe|ct.botto|
|00001db0| 6d 20 2d 20 6b 53 63 72 | 6f 6c 6c 41 64 6a 75 73 |m - kScr|ollAdjus|
|00001dc0| 74 3b 0d 09 09 74 65 6d | 70 52 65 63 74 2e 6c 65 |t;...tem|pRect.le|
|00001dd0| 66 74 20 3d 20 74 65 6d | 70 52 65 63 74 2e 72 69 |ft = tem|pRect.ri|
|00001de0| 67 68 74 20 2d 20 6b 53 | 63 72 6f 6c 6c 41 64 6a |ght - kS|crollAdj|
|00001df0| 75 73 74 3b 0d 09 09 0d | 09 09 2f 2a 20 45 72 61 |ust;....|../* Era|
|00001e00| 73 65 20 69 74 20 61 6e | 64 20 74 68 65 20 73 63 |se it an|d the sc|
|00001e10| 72 6f 6c 6c 20 62 61 72 | 73 20 2a 2f 0d 09 09 45 |roll bar|s */...E|
|00001e20| 72 61 73 65 52 65 63 74 | 28 26 74 65 6d 70 52 65 |raseRect|(&tempRe|
|00001e30| 63 74 29 3b 0d 09 09 48 | 69 64 65 43 6f 6e 74 72 |ct);...H|ideContr|
|00001e40| 6f 6c 28 64 6f 63 2d 3e | 68 53 63 72 6f 6c 6c 29 |ol(doc->|hScroll)|
|00001e50| 3b 0d 09 09 48 69 64 65 | 43 6f 6e 74 72 6f 6c 28 |;...Hide|Control(|
|00001e60| 64 6f 63 2d 3e 76 53 63 | 72 6f 6c 6c 29 3b 0d 09 |doc->vSc|roll);..|
|00001e70| 09 0d 09 09 2f 2a 20 4f | 4b 2c 20 73 69 7a 65 20 |..../* O|K, size |
|00001e80| 69 74 2c 20 62 75 74 20 | 66 69 72 73 74 20 6d 61 |it, but |first ma|
|00001e90| 6b 65 20 73 75 72 65 20 | 74 68 61 74 20 74 68 65 |ke sure |that the|
|00001ea0| 20 73 69 7a 65 20 69 73 | 20 77 69 74 68 69 6e 20 | size is| within |
|00001eb0| 6c 69 6d 69 74 73 20 28 | 75 73 65 72 73 0d 09 09 |limits (|users...|
|00001ec0| 63 61 6e 20 68 6f 6c 64 | 20 64 6f 77 6e 20 74 68 |can hold| down th|
|00001ed0| 65 20 63 6f 6d 6d 61 6e | 64 20 6b 65 79 20 74 6f |e comman|d key to|
|00001ee0| 20 62 79 70 61 73 73 20 | 74 68 65 20 6c 69 6d 69 | bypass |the limi|
|00001ef0| 74 2c 20 62 75 74 20 77 | 65 20 77 6f 6e 27 74 20 |t, but w|e won't |
|00001f00| 6c 65 74 20 27 65 6d 29 | 2e 20 0d 09 09 4e 6f 74 |let 'em)|. ...Not|
|00001f10| 65 20 74 68 61 74 20 77 | 65 20 73 75 62 74 72 61 |e that w|e subtra|
|00001f20| 63 74 20 31 20 66 72 6f | 6d 20 74 68 65 20 6c 69 |ct 1 fro|m the li|
|00001f30| 6d 69 74 73 20 74 6f 20 | 61 63 63 6f 75 6e 74 20 |mits to |account |
|00001f40| 66 6f 72 20 74 68 65 20 | 77 69 6e 64 6f 77 20 66 |for the |window f|
|00001f50| 72 61 6d 65 20 2a 2f 0d | 09 09 68 53 69 7a 65 20 |rame */.|..hSize |
|00001f60| 3d 20 4c 6f 57 6f 72 64 | 28 73 69 7a 65 29 3b 0d |= LoWord|(size);.|
|00001f70| 09 09 76 53 69 7a 65 20 | 3d 20 48 69 57 6f 72 64 |..vSize |= HiWord|
|00001f80| 28 73 69 7a 65 29 3b 0d | 09 09 69 66 28 68 53 69 |(size);.|..if(hSi|
|00001f90| 7a 65 20 3e 20 6c 69 6d | 69 74 73 2e 72 69 67 68 |ze > lim|its.righ|
|00001fa0| 74 20 2d 20 31 29 20 68 | 53 69 7a 65 20 3d 20 6c |t - 1) h|Size = l|
|00001fb0| 69 6d 69 74 73 2e 72 69 | 67 68 74 20 2d 20 67 44 |imits.ri|ght - gD|
|00001fc0| 6f 63 46 72 61 6d 65 57 | 69 64 74 68 3b 0d 09 09 |ocFrameW|idth;...|
|00001fd0| 69 66 28 76 53 69 7a 65 | 20 3e 20 6c 69 6d 69 74 |if(vSize| > limit|
|00001fe0| 73 2e 62 6f 74 74 6f 6d | 20 2d 20 31 29 20 76 53 |s.bottom| - 1) vS|
|00001ff0| 69 7a 65 20 3d 20 6c 69 | 6d 69 74 73 2e 62 6f 74 |ize = li|mits.bot|
|00002000| 74 6f 6d 20 2d 20 67 44 | 6f 63 46 72 61 6d 65 57 |tom - gD|ocFrameW|
|00002010| 69 64 74 68 3b 0d 09 09 | 53 69 7a 65 57 69 6e 64 |idth;...|SizeWind|
|00002020| 6f 77 28 77 69 6e 64 2c | 20 68 53 69 7a 65 2c 20 |ow(wind,| hSize, |
|00002030| 76 53 69 7a 65 2c 20 74 | 72 75 65 29 3b 0d 09 09 |vSize, t|rue);...|
|00002040| 43 6c 69 70 52 65 63 74 | 28 26 77 69 6e 64 2d 3e |ClipRect|(&wind->|
|00002050| 70 6f 72 74 52 65 63 74 | 29 3b 0d 09 09 0d 09 09 |portRect|);......|
|00002060| 2f 2a 20 61 64 6a 75 73 | 74 20 73 63 72 6f 6c 6c |/* adjus|t scroll|
|00002070| 42 61 72 73 20 2a 2f 0d | 09 09 41 64 6a 75 73 74 |Bars */.|..Adjust|
|00002080| 53 63 72 6f 6c 6c 62 61 | 72 73 28 77 69 6e 64 2c |Scrollba|rs(wind,|
|00002090| 20 74 72 75 65 29 3b 0d | 09 09 0d 09 09 2f 2a 20 | true);.|...../* |
|000020a0| 72 65 2d 73 68 6f 77 20 | 63 6f 6e 74 72 6f 6c 73 |re-show |controls|
|000020b0| 20 69 66 20 69 6e 20 74 | 68 65 20 66 72 6f 6e 74 | if in t|he front|
|000020c0| 20 2a 2f 0d 09 09 69 66 | 28 46 72 6f 6e 74 57 69 | */...if|(FrontWi|
|000020d0| 6e 64 6f 77 28 29 20 3d | 3d 20 77 69 6e 64 29 0d |ndow() =|= wind).|
|000020e0| 09 09 7b 0d 09 09 09 53 | 68 6f 77 43 6f 6e 74 72 |..{....S|howContr|
|000020f0| 6f 6c 28 64 6f 63 2d 3e | 68 53 63 72 6f 6c 6c 29 |ol(doc->|hScroll)|
|00002100| 3b 0d 09 09 09 53 68 6f | 77 43 6f 6e 74 72 6f 6c |;....Sho|wControl|
|00002110| 28 64 6f 63 2d 3e 76 53 | 63 72 6f 6c 6c 29 3b 0d |(doc->vS|croll);.|
|00002120| 09 09 7d 0d 09 09 09 0d | 09 09 2f 2a 20 4d 61 6b |..}.....|../* Mak|
|00002130| 65 20 73 75 72 65 20 61 | 20 72 65 64 72 61 77 20 |e sure a| redraw |
|00002140| 68 61 70 70 65 6e 73 20 | 2a 2f 0d 09 09 49 6e 76 |happens |*/...Inv|
|00002150| 61 6c 52 65 63 74 28 26 | 77 69 6e 64 2d 3e 70 6f |alRect(&|wind->po|
|00002160| 72 74 52 65 63 74 29 3b | 0d 09 7d 0d 7d 0d 0d 2f |rtRect);|..}.}../|
|00002170| 2a 20 43 61 6c 6c 65 64 | 20 77 68 65 6e 20 74 68 |* Called| when th|
|00002180| 65 20 75 73 65 72 20 63 | 6c 69 63 6b 73 20 69 6e |e user c|licks in|
|00002190| 20 74 68 65 20 7a 6f 6f | 6d 20 62 6f 78 20 6f 66 | the zoo|m box of|
|000021a0| 20 61 20 77 69 6e 64 6f | 77 2e 20 49 74 20 63 61 | a windo|w. It ca|
|000021b0| 6c 6c 73 20 61 20 72 6f | 75 74 69 6e 65 20 74 6f |lls a ro|utine to|
|000021c0| 20 66 69 6e 64 0d 61 6e | 64 20 69 6e 73 74 61 6c | find.an|d instal|
|000021d0| 6c 20 74 68 65 20 61 70 | 70 72 6f 70 72 69 61 74 |l the ap|propriat|
|000021e0| 65 20 7a 6f 6f 6d 20 72 | 65 63 74 2c 20 74 68 65 |e zoom r|ect, the|
|000021f0| 6e 20 7a 6f 6f 6d 73 20 | 69 74 2c 20 61 64 6a 75 |n zooms |it, adju|
|00002200| 73 74 69 6e 67 20 74 68 | 65 20 73 63 72 6f 6c 6c |sting th|e scroll|
|00002210| 20 62 61 72 73 20 61 6e | 64 20 73 6f 20 0d 6f 6e | bars an|d so .on|
|00002220| 20 2a 2f 0d 76 6f 69 64 | 20 09 41 70 70 5a 6f 6f | */.void| .AppZoo|
|00002230| 6d 57 69 6e 64 6f 77 28 | 57 69 6e 64 6f 77 50 74 |mWindow(|WindowPt|
|00002240| 72 20 77 69 6e 64 2c 20 | 73 68 6f 72 74 20 7a 6f |r wind, |short zo|
|00002250| 6f 6d 44 69 72 29 0d 7b | 0d 09 52 65 63 74 09 09 |omDir).{|..Rect..|
|00002260| 09 77 6f 72 6c 64 52 65 | 63 74 3b 0d 09 44 6f 63 |.worldRe|ct;..Doc|
|00002270| 75 6d 65 6e 74 50 65 65 | 6b 09 64 6f 63 3b 0d 09 |umentPee|k.doc;..|
|00002280| 0d 09 2f 2a 20 44 6f 20 | 6e 6f 74 68 69 6e 67 20 |../* Do |nothing |
|00002290| 69 66 20 6e 6f 74 20 6f | 75 72 20 77 69 6e 64 6f |if not o|ur windo|
|000022a0| 77 20 2a 2f 0d 09 69 66 | 28 49 73 41 70 70 57 69 |w */..if|(IsAppWi|
|000022b0| 6e 64 6f 77 28 77 69 6e | 64 29 20 3d 3d 20 66 61 |ndow(win|d) == fa|
|000022c0| 6c 73 65 29 0d 09 09 72 | 65 74 75 72 6e 3b 0d 09 |lse)...r|eturn;..|
|000022d0| 09 0d 09 64 6f 63 20 3d | 20 28 44 6f 63 75 6d 65 |...doc =| (Docume|
|000022e0| 6e 74 50 65 65 6b 29 77 | 69 6e 64 3b 0d 09 2f 2a |ntPeek)w|ind;../*|
|000022f0| 20 47 65 74 20 74 68 65 | 20 6d 61 78 69 6d 75 6d | Get the| maximum|
|00002300| 20 73 69 7a 65 20 6f 66 | 20 74 68 65 20 77 69 6e | size of| the win|
|00002310| 64 6f 77 2c 20 61 6e 64 | 20 73 65 74 20 75 70 20 |dow, and| set up |
|00002320| 74 68 65 20 77 69 6e 64 | 6f 77 20 66 6f 72 20 74 |the wind|ow for t|
|00002330| 68 65 20 7a 6f 6f 6d 20 | 2a 2f 0d 09 77 6f 72 6c |he zoom |*/..worl|
|00002340| 64 52 65 63 74 20 3d 20 | 64 6f 63 2d 3e 77 6f 72 |dRect = |doc->wor|
|00002350| 6c 64 2d 3e 70 6f 72 74 | 52 65 63 74 3b 20 2f 2a |ld->port|Rect; /*|
|00002360| 20 74 6f 70 20 6c 65 66 | 74 20 69 73 20 61 6c 77 | top lef|t is alw|
|00002370| 61 79 73 20 30 2c 20 30 | 20 2a 2f 0d 09 52 65 61 |ays 0, 0| */..Rea|
|00002380| 64 79 57 5a 6f 6f 6d 28 | 77 69 6e 64 2c 20 7a 6f |dyWZoom(|wind, zo|
|00002390| 6f 6d 44 69 72 2c 20 77 | 6f 72 6c 64 52 65 63 74 |omDir, w|orldRect|
|000023a0| 2e 72 69 67 68 74 20 2b | 20 6b 53 63 72 6f 6c 6c |.right +| kScroll|
|000023b0| 41 64 6a 75 73 74 2c 20 | 77 6f 72 6c 64 52 65 63 |Adjust, |worldRec|
|000023c0| 74 2e 62 6f 74 74 6f 6d | 20 2b 20 6b 53 63 72 6f |t.bottom| + kScro|
|000023d0| 6c 6c 41 64 6a 75 73 74 | 29 3b 0d 09 0d 09 2f 2a |llAdjust|);..../*|
|000023e0| 20 4f 6b 2c 20 7a 6f 6f | 6d 20 74 68 61 74 20 73 | Ok, zoo|m that s|
|000023f0| 75 63 6b 65 72 2e 20 45 | 72 61 73 65 20 74 68 65 |ucker. E|rase the|
|00002400| 20 77 69 6e 64 6f 77 20 | 63 6f 6d 70 6c 65 74 65 | window |complete|
|00002410| 6c 79 20 66 69 72 73 74 | 3a 20 63 6f 73 6d 65 74 |ly first|: cosmet|
|00002420| 69 63 61 6c 6c 79 20 74 | 68 69 73 20 6c 6f 6f 6b |ically t|his look|
|00002430| 73 0d 09 09 67 6f 6f 64 | 20 2a 2f 0d 09 53 65 74 |s...good| */..Set|
|00002440| 50 6f 72 74 28 77 69 6e | 64 29 3b 0d 09 45 72 61 |Port(win|d);..Era|
|00002450| 73 65 52 65 63 74 28 26 | 77 69 6e 64 2d 3e 70 6f |seRect(&|wind->po|
|00002460| 72 74 52 65 63 74 29 3b | 0d 09 5a 6f 6f 6d 57 69 |rtRect);|..ZoomWi|
|00002470| 6e 64 6f 77 28 77 69 6e | 64 2c 20 7a 6f 6f 6d 44 |ndow(win|d, zoomD|
|00002480| 69 72 2c 20 74 72 75 65 | 29 3b 0d 09 43 6c 69 70 |ir, true|);..Clip|
|00002490| 52 65 63 74 28 26 77 69 | 6e 64 2d 3e 70 6f 72 74 |Rect(&wi|nd->port|
|000024a0| 52 65 63 74 29 3b 0d 09 | 49 6e 76 61 6c 52 65 63 |Rect);..|InvalRec|
|000024b0| 74 28 26 77 69 6e 64 2d | 3e 70 6f 72 74 52 65 63 |t(&wind-|>portRec|
|000024c0| 74 29 3b 0d 0d 09 2f 2a | 20 52 65 73 65 74 20 73 |t);.../*| Reset s|
|000024d0| 63 72 6f 6c 6c 20 62 61 | 72 73 2c 20 65 74 63 2c |croll ba|rs, etc,|
|000024e0| 20 68 69 64 69 6e 67 20 | 74 68 65 6d 20 66 69 72 | hiding |them fir|
|000024f0| 73 74 20 74 6f 20 61 76 | 6f 69 64 20 75 6e 6e 65 |st to av|oid unne|
|00002500| 63 65 73 73 61 72 79 20 | 64 72 61 77 69 6e 67 2e |cessary |drawing.|
|00002510| 20 57 65 20 61 72 65 0d | 09 61 73 73 75 6d 69 6e | We are.|.assumin|
|00002520| 67 20 68 65 72 65 20 74 | 68 61 74 20 74 68 65 20 |g here t|hat the |
|00002530| 77 69 6e 64 6f 77 20 69 | 73 20 69 6e 20 66 72 6f |window i|s in fro|
|00002540| 6e 74 20 28 69 74 20 68 | 61 73 20 74 6f 20 62 65 |nt (it h|as to be|
|00002550| 20 74 6f 20 62 65 20 7a | 6f 6f 6d 65 64 20 2a 2f | to be z|oomed */|
|00002560| 0d 09 48 69 64 65 43 6f | 6e 74 72 6f 6c 28 64 6f |..HideCo|ntrol(do|
|00002570| 63 2d 3e 68 53 63 72 6f | 6c 6c 29 3b 0d 09 48 69 |c->hScro|ll);..Hi|
|00002580| 64 65 43 6f 6e 74 72 6f | 6c 28 64 6f 63 2d 3e 76 |deContro|l(doc->v|
|00002590| 53 63 72 6f 6c 6c 29 3b | 0d 09 41 64 6a 75 73 74 |Scroll);|..Adjust|
|000025a0| 53 63 72 6f 6c 6c 62 61 | 72 73 28 77 69 6e 64 2c |Scrollba|rs(wind,|
|000025b0| 20 74 72 75 65 29 3b 0d | 09 53 68 6f 77 43 6f 6e | true);.|.ShowCon|
|000025c0| 74 72 6f 6c 28 64 6f 63 | 2d 3e 68 53 63 72 6f 6c |trol(doc|->hScrol|
|000025d0| 6c 29 3b 0d 09 53 68 6f | 77 43 6f 6e 74 72 6f 6c |l);..Sho|wControl|
|000025e0| 28 64 6f 63 2d 3e 76 53 | 63 72 6f 6c 6c 29 3b 0d |(doc->vS|croll);.|
|000025f0| 7d 0d 09 0d 2f 2a 20 43 | 61 6c 6c 65 64 20 77 68 |}.../* C|alled wh|
|00002600| 65 6e 20 74 68 65 72 65 | 20 69 73 20 61 20 63 6c |en there| is a cl|
|00002610| 69 63 6b 20 69 6e 20 74 | 68 65 20 6d 65 6e 75 20 |ick in t|he menu |
|00002620| 62 61 72 2c 20 62 65 66 | 6f 72 65 20 74 68 65 20 |bar, bef|ore the |
|00002630| 6d 65 6e 75 20 69 73 20 | 73 68 6f 77 6e 2e 20 54 |menu is |shown. T|
|00002640| 68 69 73 20 69 73 0d 74 | 68 65 20 61 70 70 27 73 |his is.t|he app's|
|00002650| 20 6f 70 70 6f 72 74 75 | 6e 69 74 79 20 74 6f 20 | opportu|nity to |
|00002660| 65 6e 61 62 6c 65 20 61 | 6e 64 20 64 69 73 61 62 |enable a|nd disab|
|00002670| 6c 65 20 6d 65 6e 75 20 | 69 74 65 6d 73 2e 20 2a |le menu |items. *|
|00002680| 2f 0d 76 6f 69 64 09 41 | 70 70 41 64 6a 75 73 74 |/.void.A|ppAdjust|
|00002690| 4d 65 6e 75 73 28 29 0d | 7b 0d 09 4d 65 6e 75 48 |Menus().|{..MenuH|
|000026a0| 61 6e 64 6c 65 09 6d 68 | 6e 64 6c 3b 0d 09 6c 6f |andle.mh|ndl;..lo|
|000026b0| 6e 67 09 09 70 69 63 74 | 53 69 7a 65 2c 20 69 67 |ng..pict|Size, ig|
|000026c0| 6e 6f 72 65 64 3b 0d 09 | 42 6f 6f 6c 65 61 6e 09 |nored;..|Boolean.|
|000026d0| 09 77 69 6e 64 6f 77 73 | 55 70 3b 0d 09 0d 09 2f |.windows|Up;..../|
|000026e0| 2a 20 4f 4b 2c 20 66 69 | 72 73 74 20 74 68 65 20 |* OK, fi|rst the |
|000026f0| 66 69 6c 65 20 6d 65 6e | 75 2e 20 49 66 20 74 68 |file men|u. If th|
|00002700| 65 20 77 69 6e 64 6f 77 | 73 20 61 72 65 20 75 70 |e window|s are up|
|00002710| 2c 20 74 68 65 6e 20 65 | 6e 61 62 6c 65 20 43 6c |, then e|nable Cl|
|00002720| 6f 73 65 2c 20 53 61 76 | 65 20 28 69 66 0d 09 09 |ose, Sav|e (if...|
|00002730| 74 68 65 20 77 69 6e 64 | 6f 77 20 6e 65 65 64 73 |the wind|ow needs|
|00002740| 20 73 61 76 69 6e 67 29 | 2c 20 61 6e 64 20 53 61 | saving)|, and Sa|
|00002750| 76 65 20 41 73 2e 20 41 | 6c 73 6f 20 65 6e 61 62 |ve As. A|lso enab|
|00002760| 6c 65 20 50 61 67 65 20 | 53 65 74 75 70 20 61 6e |le Page |Setup an|
|00002770| 64 20 50 72 69 6e 74 20 | 69 66 0d 09 09 74 68 65 |d Print |if...the|
|00002780| 20 70 72 69 6e 74 20 72 | 65 63 6f 72 64 20 65 78 | print r|ecord ex|
|00002790| 69 73 74 73 2e 20 49 66 | 20 74 68 65 72 65 20 61 |ists. If| there a|
|000027a0| 72 65 20 6e 6f 20 77 69 | 6e 64 6f 77 73 20 6f 70 |re no wi|ndows op|
|000027b0| 65 6e 2c 20 64 69 73 61 | 62 6c 65 20 73 61 6d 65 |en, disa|ble same|
|000027c0| 2e 20 4f 70 65 6e 20 0d | 09 09 61 6e 64 20 51 75 |. Open .|..and Qu|
|000027d0| 69 74 20 61 72 65 20 61 | 6c 77 61 79 73 20 65 6e |it are a|lways en|
|000027e0| 61 62 6c 65 64 2e 20 20 | 2a 2f 0d 09 0d 09 77 69 |abled. |*/....wi|
|000027f0| 6e 64 6f 77 73 55 70 20 | 3d 20 28 28 57 69 6e 64 |ndowsUp |= ((Wind|
|00002800| 6f 77 50 65 65 6b 29 67 | 53 72 63 57 69 6e 64 50 |owPeek)g|SrcWindP|
|00002810| 74 72 29 2d 3e 76 69 73 | 69 62 6c 65 3b 0d 09 6d |tr)->vis|ible;..m|
|00002820| 68 6e 64 6c 20 3d 20 67 | 53 68 65 6c 6c 4d 65 6e |hndl = g|ShellMen|
|00002830| 75 48 61 6e 64 6c 65 73 | 5b 6b 46 69 6c 65 4d 65 |uHandles|[kFileMe|
|00002840| 6e 75 5d 3b 0d 09 69 66 | 28 77 69 6e 64 6f 77 73 |nu];..if|(windows|
|00002850| 55 70 29 0d 09 7b 0d 09 | 09 45 6e 61 62 6c 65 49 |Up)..{..|.EnableI|
|00002860| 74 65 6d 28 6d 68 6e 64 | 6c 2c 20 69 43 6c 6f 73 |tem(mhnd|l, iClos|
|00002870| 65 29 3b 0d 09 09 69 66 | 28 28 28 44 6f 63 75 6d |e);...if|(((Docum|
|00002880| 65 6e 74 50 65 65 6b 29 | 46 72 6f 6e 74 57 69 6e |entPeek)|FrontWin|
|00002890| 64 6f 77 28 29 29 2d 3e | 64 69 72 74 79 29 0d 09 |dow())->|dirty)..|
|000028a0| 09 09 45 6e 61 62 6c 65 | 49 74 65 6d 28 6d 68 6e |..Enable|Item(mhn|
|000028b0| 64 6c 2c 20 69 53 61 76 | 65 29 3b 0d 09 09 65 6c |dl, iSav|e);...el|
|000028c0| 73 65 0d 09 09 09 44 69 | 73 61 62 6c 65 49 74 65 |se....Di|sableIte|
|000028d0| 6d 28 6d 68 6e 64 6c 2c | 20 69 53 61 76 65 29 3b |m(mhndl,| iSave);|
|000028e0| 0d 09 09 45 6e 61 62 6c | 65 49 74 65 6d 28 6d 68 |...Enabl|eItem(mh|
|000028f0| 6e 64 6c 2c 20 69 53 61 | 76 65 41 73 29 3b 0d 09 |ndl, iSa|veAs);..|
|00002900| 09 69 66 28 67 50 72 69 | 6e 74 52 65 63 48 61 6e |.if(gPri|ntRecHan|
|00002910| 64 6c 65 20 21 3d 20 6e | 69 6c 29 0d 09 09 7b 0d |dle != n|il)...{.|
|00002920| 09 09 09 45 6e 61 62 6c | 65 49 74 65 6d 28 6d 68 |...Enabl|eItem(mh|
|00002930| 6e 64 6c 2c 20 69 50 61 | 67 65 53 65 74 75 70 29 |ndl, iPa|geSetup)|
|00002940| 3b 0d 09 09 09 45 6e 61 | 62 6c 65 49 74 65 6d 28 |;....Ena|bleItem(|
|00002950| 6d 68 6e 64 6c 2c 20 69 | 50 72 69 6e 74 29 3b 0d |mhndl, i|Print);.|
|00002960| 09 09 7d 0d 09 7d 0d 09 | 65 6c 73 65 09 09 2f 2a |..}..}..|else../*|
|00002970| 20 54 68 65 20 77 69 6e | 64 6f 77 73 20 61 72 65 | The win|dows are|
|00002980| 20 63 6c 6f 73 65 64 20 | 2a 2f 0d 09 7b 0d 09 09 | closed |*/..{...|
|00002990| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 6d 68 6e 64 |DisableI|tem(mhnd|
|000029a0| 6c 2c 20 69 43 6c 6f 73 | 65 29 3b 0d 09 09 44 69 |l, iClos|e);...Di|
|000029b0| 73 61 62 6c 65 49 74 65 | 6d 28 6d 68 6e 64 6c 2c |sableIte|m(mhndl,|
|000029c0| 20 69 53 61 76 65 29 3b | 0d 09 09 44 69 73 61 62 | iSave);|...Disab|
|000029d0| 6c 65 49 74 65 6d 28 6d | 68 6e 64 6c 2c 20 69 53 |leItem(m|hndl, iS|
|000029e0| 61 76 65 41 73 29 3b 0d | 09 09 44 69 73 61 62 6c |aveAs);.|..Disabl|
|000029f0| 65 49 74 65 6d 28 6d 68 | 6e 64 6c 2c 20 69 50 61 |eItem(mh|ndl, iPa|
|00002a00| 67 65 53 65 74 75 70 29 | 3b 0d 09 09 44 69 73 61 |geSetup)|;...Disa|
|00002a10| 62 6c 65 49 74 65 6d 28 | 6d 68 6e 64 6c 2c 20 69 |bleItem(|mhndl, i|
|00002a20| 50 72 69 6e 74 29 3b 0d | 09 7d 0d 09 0d 09 2f 2a |Print);.|.}..../*|
|00002a30| 20 4e 6f 77 20 74 68 65 | 20 45 64 69 74 20 4d 65 | Now the| Edit Me|
|00002a40| 6e 75 2e 20 49 66 20 74 | 68 65 20 77 69 6e 64 6f |nu. If t|he windo|
|00002a50| 77 73 20 61 72 65 20 75 | 70 2c 20 65 6e 61 62 6c |ws are u|p, enabl|
|00002a60| 65 20 43 75 74 2c 20 43 | 6f 70 79 2c 20 61 6e 64 |e Cut, C|opy, and|
|00002a70| 20 43 6c 65 61 72 20 0d | 09 09 61 75 74 6f 6d 61 | Clear .|..automa|
|00002a80| 74 69 63 61 6c 6c 79 2c | 20 61 6e 64 20 55 6e 64 |tically,| and Und|
|00002a90| 6f 20 61 6e 64 20 50 61 | 73 74 65 20 63 6f 6e 64 |o and Pa|ste cond|
|00002aa0| 69 74 69 6f 6e 61 6c 6c | 79 2e 20 4f 74 68 65 72 |itionall|y. Other|
|00002ab0| 77 69 73 65 2c 20 64 69 | 73 61 62 6c 65 20 65 76 |wise, di|sable ev|
|00002ac0| 65 72 79 74 68 69 6e 67 | 20 2a 2f 0d 09 09 0d 09 |erything| */.....|
|00002ad0| 6d 68 6e 64 6c 20 3d 20 | 67 53 68 65 6c 6c 4d 65 |mhndl = |gShellMe|
|00002ae0| 6e 75 48 61 6e 64 6c 65 | 73 5b 6b 45 64 69 74 4d |nuHandle|s[kEditM|
|00002af0| 65 6e 75 5d 3b 0d 09 69 | 66 28 77 69 6e 64 6f 77 |enu];..i|f(window|
|00002b00| 73 55 70 29 0d 09 7b 0d | 09 09 45 6e 61 62 6c 65 |sUp)..{.|..Enable|
|00002b10| 49 74 65 6d 28 6d 68 6e | 64 6c 2c 20 69 43 75 74 |Item(mhn|dl, iCut|
|00002b20| 29 3b 0d 09 09 45 6e 61 | 62 6c 65 49 74 65 6d 28 |);...Ena|bleItem(|
|00002b30| 6d 68 6e 64 6c 2c 20 69 | 43 6f 70 79 29 3b 0d 09 |mhndl, i|Copy);..|
|00002b40| 09 45 6e 61 62 6c 65 49 | 74 65 6d 28 6d 68 6e 64 |.EnableI|tem(mhnd|
|00002b50| 6c 2c 20 69 43 6c 65 61 | 72 29 3b 0d 09 09 0d 09 |l, iClea|r);.....|
|00002b60| 09 2f 2a 20 46 6f 72 20 | 50 61 73 74 65 3a 20 68 |./* For |Paste: h|
|00002b70| 61 76 65 20 74 6f 20 73 | 65 65 20 69 66 20 74 68 |ave to s|ee if th|
|00002b80| 65 72 65 20 69 73 20 61 | 20 50 49 43 54 20 69 6e |ere is a| PICT in|
|00002b90| 20 74 68 65 20 73 63 72 | 61 70 20 2a 2f 0d 09 09 | the scr|ap */...|
|00002ba0| 70 69 63 74 53 69 7a 65 | 20 3d 20 47 65 74 53 63 |pictSize| = GetSc|
|00002bb0| 72 61 70 28 6e 69 6c 2c | 20 27 50 49 43 54 27 2c |rap(nil,| 'PICT',|
|00002bc0| 20 26 69 67 6e 6f 72 65 | 64 29 3b 0d 09 09 69 66 | &ignore|d);...if|
|00002bd0| 28 70 69 63 74 53 69 7a | 65 20 3e 20 30 29 20 2f |(pictSiz|e > 0) /|
|00002be0| 2a 20 57 65 20 68 61 76 | 65 20 61 20 50 49 43 54 |* We hav|e a PICT|
|00002bf0| 20 69 6e 20 74 68 65 20 | 73 63 72 61 70 20 2a 2f | in the |scrap */|
|00002c00| 0d 09 09 09 45 6e 61 62 | 6c 65 49 74 65 6d 28 6d |....Enab|leItem(m|
|00002c10| 68 6e 64 6c 2c 20 69 50 | 61 73 74 65 29 3b 0d 09 |hndl, iP|aste);..|
|00002c20| 09 65 6c 73 65 0d 09 09 | 09 44 69 73 61 62 6c 65 |.else...|.Disable|
|00002c30| 49 74 65 6d 28 6d 68 6e | 64 6c 2c 20 69 50 61 73 |Item(mhn|dl, iPas|
|00002c40| 74 65 29 3b 0d 09 09 0d | 09 09 2f 2a 20 4e 6f 77 |te);....|../* Now|
|00002c50| 20 55 6e 64 6f 3a 20 68 | 61 76 65 20 74 6f 20 73 | Undo: h|ave to s|
|00002c60| 65 65 20 69 66 20 74 68 | 65 20 75 6e 64 6f 20 62 |ee if th|e undo b|
|00002c70| 75 66 66 65 72 20 65 78 | 69 73 74 73 20 61 6e 64 |uffer ex|ists and|
|00002c80| 20 61 20 74 61 72 67 65 | 74 20 65 78 69 73 74 73 | a targe|t exists|
|00002c90| 20 2a 2f 0d 09 09 69 66 | 28 67 55 6e 64 6f 42 75 | */...if|(gUndoBu|
|00002ca0| 66 66 65 72 20 21 3d 20 | 6e 69 6c 20 26 26 20 67 |ffer != |nil && g|
|00002cb0| 55 6e 64 6f 54 61 72 67 | 65 74 20 21 3d 20 6e 69 |UndoTarg|et != ni|
|00002cc0| 6c 29 20 2f 2a 20 57 65 | 20 68 61 76 65 20 61 20 |l) /* We| have a |
|00002cd0| 62 75 66 66 65 72 20 61 | 6e 64 20 61 20 74 61 72 |buffer a|nd a tar|
|00002ce0| 67 65 74 20 2a 2f 0d 09 | 09 09 45 6e 61 62 6c 65 |get */..|..Enable|
|00002cf0| 49 74 65 6d 28 6d 68 6e | 64 6c 2c 20 69 55 6e 64 |Item(mhn|dl, iUnd|
|00002d00| 6f 29 3b 0d 09 09 65 6c | 73 65 0d 09 09 09 44 69 |o);...el|se....Di|
|00002d10| 73 61 62 6c 65 49 74 65 | 6d 28 6d 68 6e 64 6c 2c |sableIte|m(mhndl,|
|00002d20| 20 69 55 6e 64 6f 29 3b | 0d 09 7d 0d 09 65 6c 73 | iUndo);|..}..els|
|00002d30| 65 0d 09 7b 0d 09 09 44 | 69 73 61 62 6c 65 49 74 |e..{...D|isableIt|
|00002d40| 65 6d 28 6d 68 6e 64 6c | 2c 20 69 55 6e 64 6f 29 |em(mhndl|, iUndo)|
|00002d50| 3b 0d 09 09 44 69 73 61 | 62 6c 65 49 74 65 6d 28 |;...Disa|bleItem(|
|00002d60| 6d 68 6e 64 6c 2c 20 69 | 43 75 74 29 3b 0d 09 09 |mhndl, i|Cut);...|
|00002d70| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 6d 68 6e 64 |DisableI|tem(mhnd|
|00002d80| 6c 2c 20 69 43 6f 70 79 | 29 3b 0d 09 09 44 69 73 |l, iCopy|);...Dis|
|00002d90| 61 62 6c 65 49 74 65 6d | 28 6d 68 6e 64 6c 2c 20 |ableItem|(mhndl, |
|00002da0| 69 50 61 73 74 65 29 3b | 0d 09 09 44 69 73 61 62 |iPaste);|...Disab|
|00002db0| 6c 65 49 74 65 6d 28 6d | 68 6e 64 6c 2c 20 69 43 |leItem(m|hndl, iC|
|00002dc0| 6c 65 61 72 29 3b 0d 09 | 7d 0d 7d 09 0d 0d 2f 2a |lear);..|}.}.../*|
|00002dd0| 20 63 61 6c 6c 65 64 20 | 77 68 65 6e 20 61 20 6d | called |when a m|
|00002de0| 65 6e 75 20 6f 74 68 65 | 72 20 74 68 61 6e 20 41 |enu othe|r than A|
|00002df0| 70 70 6c 65 2c 20 46 69 | 6c 65 2c 20 6f 72 20 45 |pple, Fi|le, or E|
|00002e00| 64 69 74 20 69 73 20 75 | 73 65 64 2e 20 2a 2f 0d |dit is u|sed. */.|
|00002e10| 76 6f 69 64 20 41 70 70 | 4d 65 6e 75 28 73 68 6f |void App|Menu(sho|
|00002e20| 72 74 20 69 64 2c 20 73 | 68 6f 72 74 20 69 74 65 |rt id, s|hort ite|
|00002e30| 6d 29 0d 7b 0d 09 73 77 | 69 74 63 68 28 69 64 29 |m).{..sw|itch(id)|
|00002e40| 0d 09 7b 0d 09 09 63 61 | 73 65 20 6b 46 69 6c 74 |..{...ca|se kFilt|
|00002e50| 65 72 4d 65 6e 75 49 44 | 3a 0d 09 09 09 44 6f 46 |erMenuID|:....DoF|
|00002e60| 69 6c 74 65 72 4d 65 6e | 75 28 69 74 65 6d 29 3b |ilterMen|u(item);|
|00002e70| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 09 0d |....brea|k;......|
|00002e80| 09 09 63 61 73 65 20 6b | 42 72 75 73 68 4d 65 6e |..case k|BrushMen|
|00002e90| 75 49 44 3a 0d 09 09 09 | 44 6f 42 72 75 73 68 4d |uID:....|DoBrushM|
|00002ea0| 65 6e 75 28 69 74 65 6d | 29 3b 0d 09 09 09 62 72 |enu(item|);....br|
|00002eb0| 65 61 6b 3b 0d 09 09 09 | 09 0d 09 09 63 61 73 65 |eak;....|....case|
|00002ec0| 20 6b 41 75 74 6f 50 61 | 69 6e 74 4d 65 6e 75 49 | kAutoPa|intMenuI|
|00002ed0| 44 3a 0d 09 09 09 44 6f | 50 61 69 6e 74 4d 65 6e |D:....Do|PaintMen|
|00002ee0| 75 28 69 74 65 6d 29 3b | 0d 09 09 09 62 72 65 61 |u(item);|....brea|
|00002ef0| 6b 3b 0d 09 09 0d 09 09 | 64 65 66 61 75 6c 74 3a |k;......|default:|
|00002f00| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 7d 0d 7d 0d |....brea|k;..}.}.|
|00002f10| 0d 2f 2a 20 43 61 6c 6c | 65 64 20 77 68 65 6e 20 |./* Call|ed when |
|00002f20| 74 68 65 20 75 73 65 72 | 20 73 65 6c 65 63 74 73 |the user| selects|
|00002f30| 20 22 4f 70 65 6e 22 20 | 66 72 6f 6d 20 74 68 65 | "Open" |from the|
|00002f40| 20 46 69 6c 65 20 6d 65 | 6e 75 2e 20 49 6e 20 74 | File me|nu. In t|
|00002f50| 68 69 73 20 61 70 70 2c | 20 6f 70 65 6e 69 6e 67 |his app,| opening|
|00002f60| 20 61 20 0d 09 50 49 43 | 54 20 66 69 6c 65 20 61 | a ..PIC|T file a|
|00002f70| 6c 77 61 79 73 20 70 75 | 74 73 20 74 68 65 20 50 |lways pu|ts the P|
|00002f80| 49 43 54 20 69 6e 74 6f | 20 74 68 65 20 73 6f 75 |ICT into| the sou|
|00002f90| 72 63 65 20 77 69 6e 64 | 6f 77 2c 20 61 6e 64 20 |rce wind|ow, and |
|00002fa0| 63 6c 65 61 72 73 20 74 | 68 65 20 64 65 73 74 69 |clears t|he desti|
|00002fb0| 6e 61 74 69 6f 6e 20 2a | 2f 0d 76 6f 69 64 09 41 |nation *|/.void.A|
|00002fc0| 70 70 4f 70 65 6e 28 76 | 6f 69 64 29 0d 7b 0d 09 |ppOpen(v|oid).{..|
|00002fd0| 53 46 54 79 70 65 4c 69 | 73 74 09 09 09 74 79 70 |SFTypeLi|st...typ|
|00002fe0| 65 4c 69 73 74 3b 0d 09 | 73 68 6f 72 74 09 09 09 |eList;..|short...|
|00002ff0| 09 6e 75 6d 54 79 70 65 | 73 2c 20 65 72 72 3b 0d |.numType|s, err;.|
|00003000| 09 53 74 61 6e 64 61 72 | 64 46 69 6c 65 52 65 70 |.Standar|dFileRep|
|00003010| 6c 79 09 72 65 70 6c 79 | 3b 0d 09 0d 09 2f 2a 20 |ly.reply|;..../* |
|00003020| 43 6c 6f 73 65 20 61 6e | 79 20 77 69 6e 64 6f 77 |Close an|y window|
|00003030| 73 20 74 68 61 74 20 6d | 69 67 68 74 20 62 65 20 |s that m|ight be |
|00003040| 6f 70 65 6e 20 6e 6f 77 | 3a 20 69 66 20 74 68 65 |open now|: if the|
|00003050| 20 75 73 65 72 20 61 62 | 6f 72 74 73 20 61 20 73 | user ab|orts a s|
|00003060| 61 76 65 2c 20 64 6f 20 | 6e 6f 74 68 69 6e 67 20 |ave, do |nothing |
|00003070| 2a 2f 0d 09 69 66 28 41 | 70 70 43 6c 6f 73 65 28 |*/..if(A|ppClose(|
|00003080| 29 20 3d 3d 20 66 61 6c | 73 65 29 0d 09 09 72 65 |) == fal|se)...re|
|00003090| 74 75 72 6e 3b 0d 0d 09 | 2f 2a 20 6f 6e 6c 79 20 |turn;...|/* only |
|000030a0| 73 68 6f 77 20 50 49 43 | 54 20 66 69 6c 65 73 20 |show PIC|T files |
|000030b0| 2a 2f 0d 09 74 79 70 65 | 4c 69 73 74 5b 30 5d 20 |*/..type|List[0] |
|000030c0| 3d 20 27 50 49 43 54 27 | 3b 0d 09 0d 09 2f 2a 20 |= 'PICT'|;..../* |
|000030d0| 53 74 61 6e 64 61 72 64 | 20 46 69 6c 65 20 44 69 |Standard| File Di|
|000030e0| 61 6c 6f 67 2c 20 73 79 | 73 74 65 6d 20 37 20 73 |alog, sy|stem 7 s|
|000030f0| 74 79 6c 65 20 2a 2f 0d | 09 53 74 61 6e 64 61 72 |tyle */.|.Standar|
|00003100| 64 47 65 74 46 69 6c 65 | 28 6e 69 6c 2c 20 31 2c |dGetFile|(nil, 1,|
|00003110| 20 74 79 70 65 4c 69 73 | 74 2c 20 26 72 65 70 6c | typeLis|t, &repl|
|00003120| 79 29 3b 0d 09 0d 09 2f | 2a 20 49 66 20 74 68 65 |y);..../|* If the|
|00003130| 79 20 63 6c 69 63 6b 65 | 64 20 22 6f 70 65 6e 22 |y clicke|d "open"|
|00003140| 2e 2e 2e 20 2a 2f 0d 09 | 69 66 28 72 65 70 6c 79 |... */..|if(reply|
|00003150| 2e 73 66 47 6f 6f 64 20 | 3d 3d 20 74 72 75 65 29 |.sfGood |== true)|
|00003160| 0d 09 7b 0d 09 09 2f 2a | 20 41 20 62 69 67 20 67 |..{.../*| A big g|
|00003170| 6e 61 72 6c 79 20 72 6f | 75 74 69 6e 65 20 74 68 |narly ro|utine th|
|00003180| 61 74 20 73 65 74 73 20 | 65 76 65 72 79 74 68 69 |at sets |everythi|
|00003190| 6e 67 20 75 70 20 61 6e | 64 20 72 65 61 64 73 20 |ng up an|d reads |
|000031a0| 69 6e 20 74 68 65 20 70 | 69 63 74 20 2a 2f 0d 09 |in the p|ict */..|
|000031b0| 09 65 72 72 20 3d 20 52 | 65 61 64 50 49 43 54 46 |.err = R|eadPICTF|
|000031c0| 69 6c 65 54 6f 4e 65 77 | 57 6f 72 6c 64 73 28 26 |ileToNew|Worlds(&|
|000031d0| 72 65 70 6c 79 2e 73 66 | 46 69 6c 65 29 3b 0d 09 |reply.sf|File);..|
|000031e0| 09 69 66 28 65 72 72 20 | 3d 3d 20 6e 6f 45 72 72 |.if(err |== noErr|
|000031f0| 29 0d 09 09 7b 0d 09 09 | 09 2f 2a 20 52 65 73 74 |)...{...|./* Rest|
|00003200| 61 72 74 20 74 68 65 20 | 62 72 75 73 68 2c 20 74 |art the |brush, t|
|00003210| 6f 20 6d 61 6b 65 20 73 | 75 72 65 20 74 68 65 72 |o make s|ure ther|
|00003220| 65 20 61 72 65 20 6e 6f | 20 6f 75 74 20 6f 66 20 |e are no| out of |
|00003230| 64 61 74 65 20 76 61 6c | 75 65 73 20 0d 09 09 09 |date val|ues ....|
|00003240| 69 6e 20 74 68 65 20 73 | 74 6f 72 61 67 65 20 2a |in the s|torage *|
|00003250| 2f 0d 09 09 09 65 72 72 | 20 3d 20 53 65 74 43 75 |/....err| = SetCu|
|00003260| 72 72 65 6e 74 42 72 75 | 73 68 28 67 43 75 72 72 |rrentBru|sh(gCurr|
|00003270| 65 6e 74 42 72 75 73 68 | 4e 75 6d 29 3b 0d 09 09 |entBrush|Num);...|
|00003280| 09 69 66 28 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |.if(err |!= noErr|
|00003290| 29 0d 09 09 09 09 44 6f | 45 72 72 6f 72 41 6c 65 |).....Do|ErrorAle|
|000032a0| 72 74 28 6b 47 65 6e 65 | 72 69 63 45 72 72 6f 72 |rt(kGene|ricError|
|000032b0| 53 74 72 2c 20 65 72 72 | 29 3b 0d 09 09 7d 0d 09 |Str, err|);...}..|
|000032c0| 09 65 6c 73 65 0d 09 09 | 09 44 6f 45 72 72 6f 72 |.else...|.DoError|
|000032d0| 41 6c 65 72 74 28 6b 42 | 61 64 52 65 61 64 53 74 |Alert(kB|adReadSt|
|000032e0| 72 2c 20 65 72 72 29 3b | 0d 09 7d 0d 7d 0d 0d 0d |r, err);|..}.}...|
|000032f0| 2f 2a 20 43 61 6c 6c 65 | 64 20 77 68 65 6e 20 74 |/* Calle|d when t|
|00003300| 68 65 20 75 73 65 72 20 | 73 65 6c 65 63 74 73 20 |he user |selects |
|00003310| 22 43 6c 6f 73 65 22 20 | 66 72 6f 6d 20 74 68 65 |"Close" |from the|
|00003320| 20 46 69 6c 65 20 6d 65 | 6e 75 2c 20 63 68 6f 6f | File me|nu, choo|
|00003330| 73 65 73 20 22 4f 70 65 | 6e 22 20 77 69 74 68 20 |ses "Ope|n" with |
|00003340| 61 20 0d 09 64 6f 63 20 | 61 6c 72 65 61 64 79 20 |a ..doc |already |
|00003350| 6f 70 65 6e 2c 20 6f 72 | 20 63 6c 69 63 6b 73 20 |open, or| clicks |
|00003360| 74 68 65 20 63 6c 6f 73 | 65 20 62 6f 78 20 6f 66 |the clos|e box of|
|00003370| 20 61 20 77 69 6e 64 6f | 77 2e 20 2a 2f 09 09 09 | a windo|w. */...|
|00003380| 0d 42 6f 6f 6c 65 61 6e | 09 41 70 70 43 6c 6f 73 |.Boolean|.AppClos|
|00003390| 65 28 76 6f 69 64 29 0d | 7b 0d 09 42 6f 6f 6c 65 |e(void).|{..Boole|
|000033a0| 61 6e 09 09 72 73 6c 74 | 20 3d 20 66 61 6c 73 65 |an..rslt| = false|
|000033b0| 3b 0d 09 0d 09 2f 2a 20 | 53 69 6e 63 65 20 74 68 |;..../* |Since th|
|000033c0| 65 20 77 69 6e 64 6f 77 | 73 20 61 72 65 20 69 6e |e window|s are in|
|000033d0| 20 70 61 69 72 73 2c 20 | 6e 65 65 64 20 74 6f 20 | pairs, |need to |
|000033e0| 68 69 64 65 20 62 6f 74 | 68 20 6f 66 20 74 68 65 |hide bot|h of the|
|000033f0| 6d 2e 20 4e 6f 74 65 20 | 74 68 61 74 20 77 65 20 |m. Note |that we |
|00003400| 64 6f 6e 27 74 0d 09 09 | 74 68 72 6f 77 20 74 68 |don't...|throw th|
|00003410| 65 6d 20 61 77 61 79 2c | 20 6a 75 73 74 20 68 69 |em away,| just hi|
|00003420| 64 65 20 74 68 65 6d 20 | 2a 2f 0d 09 69 66 28 53 |de them |*/..if(S|
|00003430| 61 76 65 43 75 72 72 65 | 6e 74 44 6f 63 73 28 29 |aveCurre|ntDocs()|
|00003440| 29 0d 09 7b 0d 09 09 48 | 69 64 65 57 69 6e 64 6f |)..{...H|ideWindo|
|00003450| 77 28 67 53 72 63 57 69 | 6e 64 50 74 72 29 3b 0d |w(gSrcWi|ndPtr);.|
|00003460| 09 09 48 69 64 65 57 69 | 6e 64 6f 77 28 67 44 73 |..HideWi|ndow(gDs|
|00003470| 74 57 69 6e 64 50 74 72 | 29 3b 0d 09 09 0d 09 09 |tWindPtr|);......|
|00003480| 2f 2a 20 54 75 72 6e 20 | 6f 66 66 20 70 61 69 6e |/* Turn |off pain|
|00003490| 74 69 6e 67 20 69 66 20 | 69 74 27 73 20 6f 6e 20 |ting if |it's on |
|000034a0| 2a 2f 0d 09 09 69 66 28 | 67 50 61 69 6e 74 69 6e |*/...if(|gPaintin|
|000034b0| 67 4e 6f 77 20 3d 3d 20 | 74 72 75 65 29 0d 09 09 |gNow == |true)...|
|000034c0| 09 44 6f 50 61 69 6e 74 | 4d 65 6e 75 28 69 53 74 |.DoPaint|Menu(iSt|
|000034d0| 61 72 74 50 61 69 6e 74 | 69 6e 67 29 3b 0d 09 09 |artPaint|ing);...|
|000034e0| 0d 09 09 2f 2a 20 54 68 | 72 6f 77 20 61 77 61 79 |.../* Th|row away|
|000034f0| 20 74 68 65 20 47 57 6f | 72 6c 64 73 20 74 6f 20 | the GWo|rlds to |
|00003500| 66 72 65 65 20 75 70 20 | 6d 65 6d 6f 72 79 2e 20 |free up |memory. |
|00003510| 2a 2f 0d 09 09 4b 69 6c | 6c 47 6c 6f 62 61 6c 47 |*/...Kil|lGlobalG|
|00003520| 57 6f 72 6c 64 73 28 29 | 3b 0d 09 09 20 0d 09 09 |Worlds()|;... ...|
|00003530| 2f 2a 20 44 69 73 61 62 | 6c 65 20 74 68 65 20 61 |/* Disab|le the a|
|00003540| 70 70 72 6f 70 72 69 61 | 74 65 20 6d 65 6e 75 73 |ppropria|te menus|
|00003550| 20 2a 2f 0d 09 09 44 69 | 73 61 62 6c 65 49 74 65 | */...Di|sableIte|
|00003560| 6d 28 67 50 61 69 6e 74 | 4d 65 6e 75 48 61 6e 64 |m(gPaint|MenuHand|
|00003570| 6c 65 73 5b 6b 46 69 6c | 74 65 72 4d 65 6e 75 5d |les[kFil|terMenu]|
|00003580| 2c 20 30 29 3b 0d 09 09 | 44 69 73 61 62 6c 65 49 |, 0);...|DisableI|
|00003590| 74 65 6d 28 67 50 61 69 | 6e 74 4d 65 6e 75 48 61 |tem(gPai|ntMenuHa|
|000035a0| 6e 64 6c 65 73 5b 6b 42 | 72 75 73 68 4d 65 6e 75 |ndles[kB|rushMenu|
|000035b0| 5d 2c 20 30 29 3b 0d 09 | 09 44 69 73 61 62 6c 65 |], 0);..|.Disable|
|000035c0| 49 74 65 6d 28 67 50 61 | 69 6e 74 4d 65 6e 75 48 |Item(gPa|intMenuH|
|000035d0| 61 6e 64 6c 65 73 5b 6b | 41 75 74 6f 50 61 69 6e |andles[k|AutoPain|
|000035e0| 74 4d 65 6e 75 5d 2c 20 | 30 29 3b 0d 09 09 44 72 |tMenu], |0);...Dr|
|000035f0| 61 77 4d 65 6e 75 42 61 | 72 28 29 3b 0d 09 09 0d |awMenuBa|r();....|
|00003600| 09 09 72 73 6c 74 20 3d | 20 74 72 75 65 3b 0d 09 |..rslt =| true;..|
|00003610| 7d 0d 09 72 65 74 75 72 | 6e 20 72 73 6c 74 3b 0d |}..retur|n rslt;.|
|00003620| 7d 0d 0d 2f 2a 20 43 61 | 6c 6c 65 64 20 77 68 65 |}../* Ca|lled whe|
|00003630| 6e 20 74 68 65 20 75 73 | 65 72 20 73 65 6c 65 63 |n the us|er selec|
|00003640| 74 73 20 22 53 61 76 65 | 22 20 66 72 6f 6d 20 74 |ts "Save|" from t|
|00003650| 68 65 20 46 69 6c 65 20 | 6d 65 6e 75 2e 20 52 65 |he File |menu. Re|
|00003660| 74 75 72 6e 73 20 61 20 | 62 6f 6f 6c 65 61 6e 20 |turns a |boolean |
|00003670| 74 68 61 74 20 69 73 20 | 0d 09 74 72 75 65 20 6f |that is |..true o|
|00003680| 6e 6c 79 20 69 66 20 41 | 70 70 53 61 76 65 41 73 |nly if A|ppSaveAs|
|00003690| 28 29 20 69 73 20 63 61 | 6c 6c 65 64 20 61 6e 64 |() is ca|lled and|
|000036a0| 20 74 68 65 20 75 73 65 | 72 20 63 61 6e 63 65 6c | the use|r cancel|
|000036b0| 73 20 74 68 65 20 73 61 | 76 65 2c 20 6f 72 20 69 |s the sa|ve, or i|
|000036c0| 66 20 74 68 65 72 65 20 | 69 73 20 61 6e 0d 09 65 |f there |is an..e|
|000036d0| 72 72 6f 72 2e 20 2a 2f | 0d 42 6f 6f 6c 65 61 6e |rror. */|.Boolean|
|000036e0| 09 41 70 70 53 61 76 65 | 28 76 6f 69 64 29 0d 7b |.AppSave|(void).{|
|000036f0| 0d 09 44 6f 63 75 6d 65 | 6e 74 50 65 65 6b 09 64 |..Docume|ntPeek.d|
|00003700| 6f 63 3b 0d 09 4f 53 45 | 72 72 09 09 09 65 72 72 |oc;..OSE|rr...err|
|00003710| 20 3d 20 6e 6f 45 72 72 | 3b 0d 09 42 6f 6f 6c 65 | = noErr|;..Boole|
|00003720| 61 6e 09 09 09 63 61 6e | 63 65 6c 65 64 20 3d 20 |an...can|celed = |
|00003730| 66 61 6c 73 65 3b 0d 09 | 57 69 6e 64 6f 77 50 74 |false;..|WindowPt|
|00003740| 72 09 09 77 69 6e 64 3b | 0d 09 0d 09 2f 2a 20 44 |r..wind;|..../* D|
|00003750| 6f 20 6e 6f 74 68 69 6e | 67 20 69 66 20 74 68 65 |o nothin|g if the|
|00003760| 20 66 72 6f 6e 74 20 77 | 69 6e 64 6f 77 20 69 73 | front w|indow is|
|00003770| 6e 27 74 20 6f 75 72 73 | 20 2a 2f 0d 09 77 69 6e |n't ours| */..win|
|00003780| 64 20 3d 20 46 72 6f 6e | 74 57 69 6e 64 6f 77 28 |d = Fron|tWindow(|
|00003790| 29 3b 0d 09 69 66 28 49 | 73 41 70 70 57 69 6e 64 |);..if(I|sAppWind|
|000037a0| 6f 77 28 77 69 6e 64 29 | 20 3d 3d 20 66 61 6c 73 |ow(wind)| == fals|
|000037b0| 65 29 0d 09 09 72 65 74 | 75 72 6e 20 66 61 6c 73 |e)...ret|urn fals|
|000037c0| 65 3b 0d 09 0d 09 2f 2a | 20 47 65 74 20 74 68 65 |e;..../*| Get the|
|000037d0| 20 77 69 6e 64 6f 77 20 | 69 6e 20 71 75 65 73 74 | window |in quest|
|000037e0| 69 6f 6e 20 2a 2f 0d 09 | 64 6f 63 20 3d 20 28 44 |ion */..|doc = (D|
|000037f0| 6f 63 75 6d 65 6e 74 50 | 65 65 6b 29 77 69 6e 64 |ocumentP|eek)wind|
|00003800| 3b 0d 0d 09 2f 2a 20 43 | 68 65 63 6b 20 74 68 65 |;.../* C|heck the|
|00003810| 20 66 69 6c 65 20 6e 61 | 6d 65 20 69 6e 20 6f 75 | file na|me in ou|
|00003820| 72 20 77 69 6e 64 6f 77 | 27 73 20 73 70 65 63 2e |r window|'s spec.|
|00003830| 20 49 66 20 65 6d 70 74 | 79 2c 20 64 6f 20 73 61 | If empt|y, do sa|
|00003840| 76 65 20 61 73 2c 20 65 | 6c 73 65 20 73 61 76 65 |ve as, e|lse save|
|00003850| 20 2a 2f 0d 09 69 66 28 | 2a 64 6f 63 2d 3e 66 69 | */..if(|*doc->fi|
|00003860| 6c 65 53 70 65 63 2e 6e | 61 6d 65 20 3d 3d 20 30 |leSpec.n|ame == 0|
|00003870| 29 0d 09 7b 0d 09 09 63 | 61 6e 63 65 6c 65 64 20 |)..{...c|anceled |
|00003880| 3d 20 41 70 70 53 61 76 | 65 41 73 28 29 3b 0d 09 |= AppSav|eAs();..|
|00003890| 7d 0d 09 65 6c 73 65 09 | 2f 2a 20 61 20 72 65 67 |}..else.|/* a reg|
|000038a0| 75 6c 61 72 20 73 61 76 | 65 2c 20 69 74 27 73 20 |ular sav|e, it's |
|000038b0| 62 65 65 6e 20 73 61 76 | 65 64 20 62 65 66 6f 72 |been sav|ed befor|
|000038c0| 65 20 2a 2f 0d 09 7b 0d | 09 09 2f 2a 20 57 72 69 |e */..{.|../* Wri|
|000038d0| 74 65 20 74 68 65 20 70 | 69 63 74 20 74 6f 20 74 |te the p|ict to t|
|000038e0| 68 65 20 66 69 6c 65 20 | 2a 2f 0d 09 09 65 72 72 |he file |*/...err|
|000038f0| 20 3d 20 57 6f 72 6c 64 | 54 6f 45 78 69 73 74 69 | = World|ToExisti|
|00003900| 6e 67 46 69 6c 65 28 26 | 64 6f 63 2d 3e 66 69 6c |ngFile(&|doc->fil|
|00003910| 65 53 70 65 63 2c 20 64 | 6f 63 2d 3e 77 6f 72 6c |eSpec, d|oc->worl|
|00003920| 64 29 3b 0d 09 09 2f 2a | 20 49 74 27 73 20 70 6f |d);.../*| It's po|
|00003930| 73 73 69 62 6c 65 20 74 | 68 61 74 20 74 68 65 20 |ssible t|hat the |
|00003940| 75 73 65 72 20 73 77 69 | 74 63 68 65 64 20 74 6f |user swi|tched to|
|00003950| 20 74 68 65 20 66 69 6e | 64 65 72 20 61 6e 64 20 | the fin|der and |
|00003960| 64 65 6c 65 74 65 64 20 | 74 68 65 0d 09 09 09 66 |deleted |the....f|
|00003970| 69 6c 65 20 6f 72 20 65 | 6a 65 63 74 65 64 20 74 |ile or e|jected t|
|00003980| 68 65 20 64 69 73 6b 20 | 69 74 27 73 20 6f 6e 2c |he disk |it's on,|
|00003990| 20 73 6f 20 6c 65 74 27 | 73 20 63 68 65 63 6b 20 | so let'|s check |
|000039a0| 74 68 65 20 65 72 72 6f | 72 2e 20 49 66 20 69 74 |the erro|r. If it|
|000039b0| 27 73 20 0d 09 09 09 66 | 6e 66 45 72 72 20 6f 72 |'s ....f|nfErr or|
|000039c0| 20 6e 73 76 45 72 72 2c | 20 64 6f 20 61 20 53 61 | nsvErr,| do a Sa|
|000039d0| 76 65 41 73 20 2a 2f 0d | 09 09 69 66 28 65 72 72 |veAs */.|..if(err|
|000039e0| 20 3d 3d 20 66 6e 66 45 | 72 72 20 7c 7c 20 65 72 | == fnfE|rr || er|
|000039f0| 72 20 3d 3d 20 6e 73 76 | 45 72 72 29 0d 09 09 7b |r == nsv|Err)...{|
|00003a00| 0d 09 09 09 65 72 72 20 | 3d 20 6e 6f 45 72 72 3b |....err |= noErr;|
|00003a10| 0d 09 09 09 63 61 6e 63 | 65 6c 65 64 20 3d 20 41 |....canc|eled = A|
|00003a20| 70 70 53 61 76 65 41 73 | 28 29 3b 0d 09 09 7d 0d |ppSaveAs|();...}.|
|00003a30| 09 09 0d 09 09 69 66 28 | 65 72 72 20 3d 3d 20 6e |.....if(|err == n|
|00003a40| 6f 45 72 72 29 0d 09 09 | 09 2f 2a 20 53 75 63 63 |oErr)...|./* Succ|
|00003a50| 65 73 73 66 75 6c 20 73 | 61 76 65 2c 20 73 6f 20 |essful s|ave, so |
|00003a60| 73 65 74 20 64 69 72 74 | 79 20 66 6c 61 67 20 74 |set dirt|y flag t|
|00003a70| 6f 20 66 61 6c 73 65 20 | 2a 2f 0d 09 09 09 64 6f |o false |*/....do|
|00003a80| 63 2d 3e 64 69 72 74 79 | 20 3d 20 66 61 6c 73 65 |c->dirty| = false|
|00003a90| 3b 0d 09 09 65 6c 73 65 | 0d 09 09 7b 0d 09 09 09 |;...else|...{....|
|00003aa0| 63 61 6e 63 65 6c 65 64 | 20 3d 20 74 72 75 65 3b |canceled| = true;|
|00003ab0| 0d 09 09 09 69 66 28 65 | 72 72 20 3d 3d 20 6d 65 |....if(e|rr == me|
|00003ac0| 6d 46 75 6c 6c 45 72 72 | 29 0d 09 09 09 09 44 6f |mFullErr|).....Do|
|00003ad0| 45 72 72 6f 72 41 6c 65 | 72 74 28 6b 4e 6f 4d 65 |ErrorAle|rt(kNoMe|
|00003ae0| 6d 53 74 72 2c 20 30 29 | 3b 0d 09 09 09 65 6c 73 |mStr, 0)|;....els|
|00003af0| 65 0d 09 09 09 09 44 6f | 45 72 72 6f 72 41 6c 65 |e.....Do|ErrorAle|
|00003b00| 72 74 28 6b 42 61 64 57 | 72 69 74 65 53 74 72 2c |rt(kBadW|riteStr,|
|00003b10| 20 65 72 72 29 3b 0d 09 | 09 7d 0d 09 7d 0d 09 72 | err);..|.}..}..r|
|00003b20| 65 74 75 72 6e 20 63 61 | 6e 63 65 6c 65 64 3b 0d |eturn ca|nceled;.|
|00003b30| 7d 0d 0d 2f 2a 20 43 61 | 6c 6c 65 64 20 77 68 65 |}../* Ca|lled whe|
|00003b40| 6e 20 74 68 65 20 75 73 | 65 72 20 73 65 6c 65 63 |n the us|er selec|
|00003b50| 74 73 20 22 53 61 76 65 | 20 41 73 2e 2e 2e 22 20 |ts "Save| As..." |
|00003b60| 66 72 6f 6d 20 74 68 65 | 20 46 69 6c 65 20 6d 65 |from the| File me|
|00003b70| 6e 75 2e 20 52 65 74 75 | 72 6e 73 20 61 20 62 6f |nu. Retu|rns a bo|
|00003b80| 6f 6c 65 61 6e 20 74 68 | 61 74 20 0d 09 69 73 20 |olean th|at ..is |
|00003b90| 74 72 75 65 20 6f 6e 6c | 79 20 69 66 20 74 68 65 |true onl|y if the|
|00003ba0| 20 75 73 65 72 20 63 61 | 6e 63 65 6c 73 20 74 68 | user ca|ncels th|
|00003bb0| 65 20 73 61 76 65 2e 20 | 2a 2f 0d 42 6f 6f 6c 65 |e save. |*/.Boole|
|00003bc0| 61 6e 09 41 70 70 53 61 | 76 65 41 73 28 76 6f 69 |an.AppSa|veAs(voi|
|00003bd0| 64 29 0d 7b 0d 09 44 6f | 63 75 6d 65 6e 74 50 65 |d).{..Do|cumentPe|
|00003be0| 65 6b 09 09 64 6f 63 3b | 0d 09 53 74 72 32 35 35 |ek..doc;|..Str255|
|00003bf0| 09 09 09 09 74 69 74 6c | 65 2c 20 70 72 6f 6d 70 |....titl|e, promp|
|00003c00| 74 3b 0d 09 73 68 6f 72 | 74 09 09 09 09 70 72 6f |t;..shor|t....pro|
|00003c10| 6d 70 74 49 44 3b 0d 09 | 53 74 61 6e 64 61 72 64 |mptID;..|Standard|
|00003c20| 46 69 6c 65 52 65 70 6c | 79 09 72 65 70 6c 79 3b |FileRepl|y.reply;|
|00003c30| 0d 09 4f 53 45 72 72 09 | 09 09 09 65 72 72 20 3d |..OSErr.|...err =|
|00003c40| 20 6e 6f 45 72 72 3b 0d | 09 42 6f 6f 6c 65 61 6e | noErr;.|.Boolean|
|00003c50| 09 09 09 09 63 61 6e 63 | 65 6c 65 64 20 3d 20 66 |....canc|eled = f|
|00003c60| 61 6c 73 65 3b 0d 09 0d | 09 69 66 28 49 73 41 70 |alse;...|.if(IsAp|
|00003c70| 70 57 69 6e 64 6f 77 28 | 46 72 6f 6e 74 57 69 6e |pWindow(|FrontWin|
|00003c80| 64 6f 77 28 29 29 20 3d | 3d 20 66 61 6c 73 65 29 |dow()) =|= false)|
|00003c90| 0d 09 09 72 65 74 75 72 | 6e 20 63 61 6e 63 65 6c |...retur|n cancel|
|00003ca0| 65 64 3b 0d 09 0d 09 2f | 2a 20 47 65 74 20 74 68 |ed;..../|* Get th|
|00003cb0| 65 20 77 69 6e 64 6f 77 | 20 77 65 20 61 72 65 20 |e window| we are |
|00003cc0| 73 61 76 69 6e 67 20 61 | 6e 64 20 69 74 73 20 74 |saving a|nd its t|
|00003cd0| 69 74 6c 65 2c 20 61 6e | 64 20 73 65 6c 65 63 74 |itle, an|d select|
|00003ce0| 20 74 68 65 20 61 70 70 | 72 6f 70 72 69 61 74 65 | the app|ropriate|
|00003cf0| 20 70 72 6f 6d 70 74 20 | 2a 2f 0d 09 64 6f 63 20 | prompt |*/..doc |
|00003d00| 3d 20 28 44 6f 63 75 6d | 65 6e 74 50 65 65 6b 29 |= (Docum|entPeek)|
|00003d10| 46 72 6f 6e 74 57 69 6e | 64 6f 77 28 29 3b 0d 09 |FrontWin|dow();..|
|00003d20| 47 65 74 57 54 69 74 6c | 65 28 28 57 69 6e 64 6f |GetWTitl|e((Windo|
|00003d30| 77 50 74 72 29 64 6f 63 | 2c 20 74 69 74 6c 65 29 |wPtr)doc|, title)|
|00003d40| 3b 0d 09 69 66 28 64 6f | 63 20 3d 3d 20 26 67 53 |;..if(do|c == &gS|
|00003d50| 72 63 44 6f 63 29 0d 09 | 09 70 72 6f 6d 70 74 49 |rcDoc)..|.promptI|
|00003d60| 44 20 3d 20 6b 53 72 63 | 53 61 76 65 50 72 6f 6d |D = kSrc|SaveProm|
|00003d70| 70 74 3b 0d 09 65 6c 73 | 65 0d 09 09 70 72 6f 6d |pt;..els|e...prom|
|00003d80| 70 74 49 44 20 3d 20 6b | 44 73 74 53 61 76 65 50 |ptID = k|DstSaveP|
|00003d90| 72 6f 6d 70 74 3b 0d 09 | 0d 09 2f 2a 20 70 75 74 |rompt;..|../* put|
|00003da0| 20 75 70 20 53 74 61 6e | 64 61 72 64 20 46 69 6c | up Stan|dard Fil|
|00003db0| 65 20 44 69 61 6c 6f 67 | 20 2a 2f 0d 09 53 74 61 |e Dialog| */..Sta|
|00003dc0| 6e 64 61 72 64 50 75 74 | 46 69 6c 65 28 54 68 65 |ndardPut|File(The|
|00003dd0| 53 74 72 28 70 72 6f 6d | 70 74 2c 20 70 72 6f 6d |Str(prom|pt, prom|
|00003de0| 70 74 49 44 29 2c 20 74 | 69 74 6c 65 2c 20 20 26 |ptID), t|itle, &|
|00003df0| 72 65 70 6c 79 29 3b 0d | 09 0d 09 2f 2a 20 49 66 |reply);.|.../* If|
|00003e00| 20 75 73 65 72 20 63 6c | 69 63 6b 65 64 20 53 61 | user cl|icked Sa|
|00003e10| 76 65 2c 20 64 6f 20 69 | 74 20 2a 2f 0d 09 69 66 |ve, do i|t */..if|
|00003e20| 28 72 65 70 6c 79 2e 73 | 66 47 6f 6f 64 20 3d 3d |(reply.s|fGood ==|
|00003e30| 20 74 72 75 65 29 0d 09 | 7b 0d 09 09 2f 2a 20 49 | true)..|{.../* I|
|00003e40| 66 20 77 65 20 61 72 65 | 20 72 65 70 6c 61 63 69 |f we are| replaci|
|00003e50| 6e 67 20 61 6e 20 65 78 | 69 73 74 69 6e 67 20 66 |ng an ex|isting f|
|00003e60| 69 6c 65 2c 20 77 65 20 | 63 61 6c 6c 20 6f 6e 65 |ile, we |call one|
|00003e70| 20 72 6f 75 74 69 6e 65 | 2c 20 69 66 20 77 65 20 | routine|, if we |
|00003e80| 61 72 65 20 0d 09 09 09 | 63 72 65 61 74 69 6e 67 |are ....|creating|
|00003e90| 20 61 20 6e 65 77 20 6f | 6e 65 2c 20 61 6e 6f 74 | a new o|ne, anot|
|00003ea0| 68 65 72 20 72 6f 75 74 | 69 6e 65 20 2a 2f 0d 09 |her rout|ine */..|
|00003eb0| 09 69 66 28 72 65 70 6c | 79 2e 73 66 52 65 70 6c |.if(repl|y.sfRepl|
|00003ec0| 61 63 69 6e 67 29 0d 09 | 09 09 65 72 72 20 3d 20 |acing)..|..err = |
|00003ed0| 57 6f 72 6c 64 54 6f 45 | 78 69 73 74 69 6e 67 46 |WorldToE|xistingF|
|00003ee0| 69 6c 65 28 26 72 65 70 | 6c 79 2e 73 66 46 69 6c |ile(&rep|ly.sfFil|
|00003ef0| 65 2c 20 64 6f 63 2d 3e | 77 6f 72 6c 64 29 3b 0d |e, doc->|world);.|
|00003f00| 09 09 65 6c 73 65 0d 09 | 09 09 65 72 72 20 3d 20 |..else..|..err = |
|00003f10| 57 6f 72 6c 64 54 6f 4e | 65 77 46 69 6c 65 28 26 |WorldToN|ewFile(&|
|00003f20| 72 65 70 6c 79 2e 73 66 | 46 69 6c 65 2c 20 64 6f |reply.sf|File, do|
|00003f30| 63 2d 3e 77 6f 72 6c 64 | 29 3b 0d 09 09 0d 09 09 |c->world|);......|
|00003f40| 69 66 28 65 72 72 20 3d | 3d 20 6e 6f 45 72 72 29 |if(err =|= noErr)|
|00003f50| 0d 09 09 7b 0d 09 09 09 | 2f 2a 09 53 75 63 63 65 |...{....|/*.Succe|
|00003f60| 73 73 66 75 6c 20 73 61 | 76 65 2c 20 73 6f 20 63 |ssful sa|ve, so c|
|00003f70| 6f 70 79 20 6f 75 72 20 | 66 69 6c 65 20 73 70 65 |opy our |file spe|
|00003f80| 63 20 69 6e 74 6f 20 74 | 68 65 20 77 69 6e 64 6f |c into t|he windo|
|00003f90| 77 20 69 6e 66 6f 2c 20 | 0d 09 09 09 09 72 65 6e |w info, |.....ren|
|00003fa0| 61 6d 65 20 74 68 65 20 | 77 69 6e 64 6f 77 2c 20 |ame the |window, |
|00003fb0| 61 6e 64 20 73 65 74 20 | 74 68 65 20 64 69 72 74 |and set |the dirt|
|00003fc0| 79 20 66 6c 61 67 20 2a | 2f 0d 09 09 09 64 6f 63 |y flag *|/....doc|
|00003fd0| 2d 3e 66 69 6c 65 53 70 | 65 63 20 3d 20 72 65 70 |->fileSp|ec = rep|
|00003fe0| 6c 79 2e 73 66 46 69 6c | 65 3b 0d 09 09 09 53 65 |ly.sfFil|e;....Se|
|00003ff0| 74 57 54 69 74 6c 65 28 | 28 57 69 6e 64 6f 77 50 |tWTitle(|(WindowP|
|00004000| 74 72 29 64 6f 63 2c 20 | 72 65 70 6c 79 2e 73 66 |tr)doc, |reply.sf|
|00004010| 46 69 6c 65 2e 6e 61 6d | 65 29 3b 0d 09 09 09 64 |File.nam|e);....d|
|00004020| 6f 63 2d 3e 64 69 72 74 | 79 20 3d 20 66 61 6c 73 |oc->dirt|y = fals|
|00004030| 65 3b 0d 09 09 7d 0d 09 | 7d 0d 09 65 6c 73 65 0d |e;...}..|}..else.|
|00004040| 09 09 63 61 6e 63 65 6c | 65 64 20 3d 20 74 72 75 |..cancel|ed = tru|
|00004050| 65 3b 0d 0d 09 69 66 28 | 65 72 72 20 21 3d 20 6e |e;...if(|err != n|
|00004060| 6f 45 72 72 29 0d 09 7b | 0d 09 09 63 61 6e 63 65 |oErr)..{|...cance|
|00004070| 6c 65 64 20 3d 20 74 72 | 75 65 3b 0d 09 09 69 66 |led = tr|ue;...if|
|00004080| 28 65 72 72 20 3d 3d 20 | 6d 65 6d 46 75 6c 6c 45 |(err == |memFullE|
|00004090| 72 72 29 0d 09 09 09 44 | 6f 45 72 72 6f 72 41 6c |rr)....D|oErrorAl|
|000040a0| 65 72 74 28 6b 4e 6f 4d | 65 6d 53 74 72 2c 20 30 |ert(kNoM|emStr, 0|
|000040b0| 29 3b 0d 09 09 65 6c 73 | 65 0d 09 09 09 44 6f 45 |);...els|e....DoE|
|000040c0| 72 72 6f 72 41 6c 65 72 | 74 28 6b 42 61 64 57 72 |rrorAler|t(kBadWr|
|000040d0| 69 74 65 53 74 72 2c 20 | 65 72 72 29 3b 0d 09 7d |iteStr, |err);..}|
|000040e0| 0d 09 0d 09 72 65 74 75 | 72 6e 20 63 61 6e 63 65 |....retu|rn cance|
|000040f0| 6c 65 64 3b 0d 7d 0d 0d | 2f 2a 20 43 61 6c 6c 65 |led;.}..|/* Calle|
|00004100| 64 20 77 68 65 6e 20 74 | 68 65 20 75 73 65 72 20 |d when t|he user |
|00004110| 73 65 6c 65 63 74 73 20 | 22 50 61 67 65 20 53 65 |selects |"Page Se|
|00004120| 74 75 70 2e 2e 2e 22 20 | 66 72 6f 6d 20 74 68 65 |tup..." |from the|
|00004130| 20 46 69 6c 65 20 6d 65 | 6e 75 2e 20 2a 2f 0d 76 | File me|nu. */.v|
|00004140| 6f 69 64 20 41 70 70 50 | 61 67 65 53 65 74 75 70 |oid AppP|ageSetup|
|00004150| 28 76 6f 69 64 29 0d 7b | 0d 09 73 68 6f 72 74 09 |(void).{|..short.|
|00004160| 65 72 72 3b 0d 09 6c 6f | 6e 67 09 73 69 7a 65 2c |err;..lo|ng.size,|
|00004170| 20 67 72 6f 77 3b 0d 09 | 0d 09 69 66 28 67 50 72 | grow;..|..if(gPr|
|00004180| 69 6e 74 52 65 63 48 61 | 6e 64 6c 65 20 21 3d 20 |intRecHa|ndle != |
|00004190| 6e 69 6c 29 0d 09 7b 0d | 09 09 50 72 4f 70 65 6e |nil)..{.|..PrOpen|
|000041a0| 28 29 3b 09 09 09 09 09 | 09 09 2f 2a 20 20 4f 70 |();.....|../* Op|
|000041b0| 65 6e 20 50 72 69 6e 74 | 20 4d 67 72 20 20 2a 2f |en Print| Mgr */|
|000041c0| 0d 09 09 65 72 72 20 3d | 20 50 72 45 72 72 6f 72 |...err =| PrError|
|000041d0| 28 29 3b 09 09 09 09 09 | 2f 2a 20 20 43 68 65 63 |();.....|/* Chec|
|000041e0| 6b 20 66 6f 72 20 65 72 | 72 6f 72 73 20 20 2a 2f |k for er|rors */|
|000041f0| 0d 09 09 69 66 28 65 72 | 72 20 3d 3d 20 6e 6f 45 |...if(er|r == noE|
|00004200| 72 72 29 0d 09 09 7b 0d | 09 09 09 50 72 53 74 6c |rr)...{.|...PrStl|
|00004210| 44 69 61 6c 6f 67 28 67 | 50 72 69 6e 74 52 65 63 |Dialog(g|PrintRec|
|00004220| 48 61 6e 64 6c 65 29 3b | 09 2f 2a 20 44 6f 20 74 |Handle);|./* Do t|
|00004230| 68 65 20 73 74 79 6c 65 | 20 64 69 61 6c 6f 67 20 |he style| dialog |
|00004240| 2a 2f 0d 09 09 7d 0d 09 | 09 50 72 43 6c 6f 73 65 |*/...}..|.PrClose|
|00004250| 28 29 3b 09 09 09 09 09 | 09 09 2f 2a 20 20 43 6c |();.....|../* Cl|
|00004260| 6f 73 65 20 50 72 69 6e | 74 20 4d 67 72 20 20 2a |ose Prin|t Mgr *|
|00004270| 2f 0d 09 7d 0d 7d 0d 0d | 2f 2a 20 43 61 6c 6c 65 |/..}.}..|/* Calle|
|00004280| 64 20 77 68 65 6e 20 74 | 68 65 20 75 73 65 72 20 |d when t|he user |
|00004290| 73 65 6c 65 63 74 73 20 | 22 50 72 69 6e 74 2e 2e |selects |"Print..|
|000042a0| 2e 22 20 66 72 6f 6d 20 | 74 68 65 20 46 69 6c 65 |." from |the File|
|000042b0| 20 6d 65 6e 75 2e 20 2a | 2f 0d 76 6f 69 64 20 41 | menu. *|/.void A|
|000042c0| 70 70 50 72 69 6e 74 28 | 76 6f 69 64 29 0d 7b 0d |ppPrint(|void).{.|
|000042d0| 09 47 57 6f 72 6c 64 50 | 74 72 09 77 6f 72 6c 64 |.GWorldP|tr.world|
|000042e0| 3b 0d 09 0d 09 2f 2a 20 | 44 6f 20 6e 6f 74 68 69 |;..../* |Do nothi|
|000042f0| 6e 67 20 69 66 20 74 68 | 65 20 66 72 6f 6e 74 20 |ng if th|e front |
|00004300| 77 69 6e 64 6f 77 20 69 | 73 6e 27 74 20 6f 75 72 |window i|sn't our|
|00004310| 73 2c 20 6f 72 20 69 66 | 20 74 68 65 72 65 20 69 |s, or if| there i|
|00004320| 73 20 6e 6f 20 70 72 69 | 6e 74 20 72 65 63 6f 72 |s no pri|nt recor|
|00004330| 64 20 2a 2f 0d 09 69 66 | 28 49 73 41 70 70 57 69 |d */..if|(IsAppWi|
|00004340| 6e 64 6f 77 28 46 72 6f | 6e 74 57 69 6e 64 6f 77 |ndow(Fro|ntWindow|
|00004350| 28 29 29 20 3d 3d 20 66 | 61 6c 73 65 20 7c 7c 20 |()) == f|alse || |
|00004360| 67 50 72 69 6e 74 52 65 | 63 48 61 6e 64 6c 65 20 |gPrintRe|cHandle |
|00004370| 3d 3d 20 6e 69 6c 29 0d | 09 09 72 65 74 75 72 6e |== nil).|..return|
|00004380| 3b 0d 09 09 0d 09 77 6f | 72 6c 64 20 3d 20 28 28 |;.....wo|rld = ((|
|00004390| 44 6f 63 75 6d 65 6e 74 | 50 65 65 6b 29 46 72 6f |Document|Peek)Fro|
|000043a0| 6e 74 57 69 6e 64 6f 77 | 28 29 29 2d 3e 77 6f 72 |ntWindow|())->wor|
|000043b0| 6c 64 3b 0d 09 50 72 69 | 6e 74 28 77 6f 72 6c 64 |ld;..Pri|nt(world|
|000043c0| 29 3b 0d 7d 0d 0d 2f 2a | 20 43 61 6c 6c 65 64 20 |);.}../*| Called |
|000043d0| 77 68 65 6e 20 74 68 65 | 20 75 73 65 72 20 73 65 |when the| user se|
|000043e0| 6c 65 63 74 73 20 22 55 | 6e 64 6f 22 20 66 72 6f |lects "U|ndo" fro|
|000043f0| 6d 20 74 68 65 20 45 64 | 69 74 20 6d 65 6e 75 2e |m the Ed|it menu.|
|00004400| 20 2a 2f 0d 76 6f 69 64 | 20 41 70 70 55 6e 64 6f | */.void| AppUndo|
|00004410| 28 76 6f 69 64 29 0d 7b | 0d 09 44 6f 63 75 6d 65 |(void).{|..Docume|
|00004420| 6e 74 50 65 65 6b 09 64 | 6f 63 3b 0d 09 47 57 6f |ntPeek.d|oc;..GWo|
|00004430| 72 6c 64 50 74 72 09 09 | 74 65 6d 70 57 6f 72 6c |rldPtr..|tempWorl|
|00004440| 64 3b 0d 09 0d 09 69 66 | 28 67 55 6e 64 6f 42 75 |d;....if|(gUndoBu|
|00004450| 66 66 65 72 20 3d 3d 20 | 6e 69 6c 20 7c 7c 20 67 |ffer == |nil || g|
|00004460| 55 6e 64 6f 54 61 72 67 | 65 74 20 3d 3d 20 6e 69 |UndoTarg|et == ni|
|00004470| 6c 29 0d 09 09 72 65 74 | 75 72 6e 3b 0d 09 09 0d |l)...ret|urn;....|
|00004480| 09 2f 2a 20 47 65 74 20 | 74 68 65 20 74 61 72 67 |./* Get |the targ|
|00004490| 65 74 20 44 6f 63 20 2a | 2f 0d 09 64 6f 63 20 3d |et Doc *|/..doc =|
|000044a0| 20 28 44 6f 63 75 6d 65 | 6e 74 50 65 65 6b 29 67 | (Docume|ntPeek)g|
|000044b0| 55 6e 64 6f 54 61 72 67 | 65 74 3b 0d 09 0d 09 2f |UndoTarg|et;..../|
|000044c0| 2a 20 53 77 61 70 20 74 | 68 65 20 77 6f 72 6c 64 |* Swap t|he world|
|000044d0| 73 3a 20 67 55 6e 64 6f | 42 75 66 66 65 72 20 67 |s: gUndo|Buffer g|
|000044e0| 65 74 73 20 61 74 74 61 | 63 68 65 64 20 74 6f 20 |ets atta|ched to |
|000044f0| 74 68 65 20 64 6f 63 2c | 20 74 68 65 20 64 6f 63 |the doc,| the doc|
|00004500| 27 73 20 0d 09 09 77 6f | 72 6c 64 20 62 65 63 6f |'s ...wo|rld beco|
|00004510| 6d 65 73 20 74 68 65 20 | 6e 65 77 20 67 55 6e 64 |mes the |new gUnd|
|00004520| 6f 42 75 66 66 65 72 20 | 2a 2f 0d 09 74 65 6d 70 |oBuffer |*/..temp|
|00004530| 57 6f 72 6c 64 20 3d 20 | 64 6f 63 2d 3e 77 6f 72 |World = |doc->wor|
|00004540| 6c 64 3b 0d 09 64 6f 63 | 2d 3e 77 6f 72 6c 64 20 |ld;..doc|->world |
|00004550| 3d 20 67 55 6e 64 6f 42 | 75 66 66 65 72 3b 0d 09 |= gUndoB|uffer;..|
|00004560| 67 55 6e 64 6f 42 75 66 | 66 65 72 20 3d 20 74 65 |gUndoBuf|fer = te|
|00004570| 6d 70 57 6f 72 6c 64 3b | 0d 09 0d 09 2f 2a 20 55 |mpWorld;|..../* U|
|00004580| 70 64 61 74 65 20 74 68 | 65 20 42 72 75 73 68 20 |pdate th|e Brush |
|00004590| 50 61 72 61 6d 73 20 2a | 2f 0d 09 69 66 28 64 6f |Params *|/..if(do|
|000045a0| 63 20 3d 3d 20 26 67 53 | 72 63 44 6f 63 29 0d 09 |c == &gS|rcDoc)..|
|000045b0| 09 67 42 72 75 73 68 53 | 74 75 66 66 2e 74 68 65 |.gBrushS|tuff.the|
|000045c0| 53 6f 75 72 63 65 20 3d | 20 64 6f 63 2d 3e 77 6f |Source =| doc->wo|
|000045d0| 72 6c 64 3b 0d 09 65 6c | 73 65 0d 09 09 67 42 72 |rld;..el|se...gBr|
|000045e0| 75 73 68 53 74 75 66 66 | 2e 74 68 65 44 65 73 74 |ushStuff|.theDest|
|000045f0| 69 6e 61 74 69 6f 6e 20 | 3d 20 64 6f 63 2d 3e 77 |ination |= doc->w|
|00004600| 6f 72 6c 64 3b 0d 0d 09 | 2f 2a 20 55 70 64 61 74 |orld;...|/* Updat|
|00004610| 65 20 74 68 65 20 77 69 | 6e 64 6f 77 20 2a 2f 0d |e the wi|ndow */.|
|00004620| 09 53 65 74 50 6f 72 74 | 28 67 55 6e 64 6f 54 61 |.SetPort|(gUndoTa|
|00004630| 72 67 65 74 29 3b 0d 09 | 49 6e 76 61 6c 52 65 63 |rget);..|InvalRec|
|00004640| 74 28 26 67 55 6e 64 6f | 54 61 72 67 65 74 2d 3e |t(&gUndo|Target->|
|00004650| 70 6f 72 74 52 65 63 74 | 29 3b 0d 7d 0d 0d 2f 2a |portRect|);.}../*|
|00004660| 20 43 61 6c 6c 65 64 20 | 77 68 65 6e 20 74 68 65 | Called |when the|
|00004670| 20 75 73 65 72 20 73 65 | 6c 65 63 74 73 20 22 43 | user se|lects "C|
|00004680| 75 74 22 20 66 72 6f 6d | 20 74 68 65 20 45 64 69 |ut" from| the Edi|
|00004690| 74 20 6d 65 6e 75 2e 20 | 2a 2f 0d 76 6f 69 64 20 |t menu. |*/.void |
|000046a0| 41 70 70 43 75 74 28 76 | 6f 69 64 29 0d 7b 0d 09 |AppCut(v|oid).{..|
|000046b0| 44 6f 63 75 6d 65 6e 74 | 50 65 65 6b 09 64 6f 63 |Document|Peek.doc|
|000046c0| 3b 0d 09 57 69 6e 64 6f | 77 50 74 72 09 09 77 69 |;..Windo|wPtr..wi|
|000046d0| 6e 64 3b 0d 09 0d 09 2f | 2a 20 44 6f 20 6e 6f 74 |nd;..../|* Do not|
|000046e0| 68 69 6e 67 20 69 66 20 | 74 68 65 20 66 72 6f 6e |hing if |the fron|
|000046f0| 74 20 77 69 6e 64 6f 77 | 20 69 73 6e 27 74 20 6f |t window| isn't o|
|00004700| 75 72 73 20 2a 2f 0d 09 | 77 69 6e 64 20 3d 20 46 |urs */..|wind = F|
|00004710| 72 6f 6e 74 57 69 6e 64 | 6f 77 28 29 3b 0d 09 69 |rontWind|ow();..i|
|00004720| 66 28 49 73 41 70 70 57 | 69 6e 64 6f 77 28 77 69 |f(IsAppW|indow(wi|
|00004730| 6e 64 29 20 3d 3d 20 66 | 61 6c 73 65 29 0d 09 09 |nd) == f|alse)...|
|00004740| 72 65 74 75 72 6e 3b 0d | 09 09 0d 09 2f 2a 20 46 |return;.|..../* F|
|00004750| 69 72 73 74 20 63 6f 70 | 79 20 70 69 63 74 20 74 |irst cop|y pict t|
|00004760| 6f 20 63 6c 69 70 62 6f | 61 72 64 20 2a 2f 0d 09 |o clipbo|ard */..|
|00004770| 69 66 28 41 70 70 43 6f | 70 79 28 29 20 3d 3d 20 |if(AppCo|py() == |
|00004780| 6e 6f 45 72 72 29 0d 09 | 7b 0d 09 09 2f 2a 20 41 |noErr)..|{.../* A|
|00004790| 6c 6c 6f 77 20 61 6e 20 | 75 6e 64 6f 20 6f 66 20 |llow an |undo of |
|000047a0| 74 68 65 20 63 75 74 20 | 2a 2f 0d 09 09 53 65 74 |the cut |*/...Set|
|000047b0| 55 70 46 6f 72 55 6e 64 | 6f 28 77 69 6e 64 29 3b |UpForUnd|o(wind);|
|000047c0| 0d 09 0d 09 09 2f 2a 20 | 54 68 65 6e 20 63 6c 65 |...../* |Then cle|
|000047d0| 61 72 20 74 68 65 20 6f | 66 66 20 77 6f 72 6c 64 |ar the o|ff world|
|000047e0| 20 61 6e 64 20 72 65 71 | 75 65 73 74 20 61 20 77 | and req|uest a w|
|000047f0| 69 6e 64 6f 77 20 75 70 | 64 61 74 65 20 2a 2f 0d |indow up|date */.|
|00004800| 09 09 64 6f 63 20 3d 20 | 28 44 6f 63 75 6d 65 6e |..doc = |(Documen|
|00004810| 74 50 65 65 6b 29 77 69 | 6e 64 3b 0d 09 09 69 66 |tPeek)wi|nd;...if|
|00004820| 28 64 6f 63 2d 3e 77 6f | 72 6c 64 20 21 3d 20 6e |(doc->wo|rld != n|
|00004830| 69 6c 29 0d 09 09 7b 0d | 09 09 09 45 72 61 73 65 |il)...{.|...Erase|
|00004840| 4f 66 66 28 64 6f 63 2d | 3e 77 6f 72 6c 64 29 3b |Off(doc-|>world);|
|00004850| 0d 09 09 7d 0d 09 09 0d | 09 09 64 6f 63 2d 3e 64 |...}....|..doc->d|
|00004860| 69 72 74 79 20 3d 20 66 | 61 6c 73 65 3b 20 20 2f |irty = f|alse; /|
|00004870| 2a 20 61 73 73 75 6d 65 | 20 6e 6f 20 6f 6e 65 20 |* assume| no one |
|00004880| 77 61 6e 74 73 20 74 6f | 20 73 61 76 65 20 61 6e |wants to| save an|
|00004890| 20 65 6d 70 74 79 20 70 | 69 63 74 75 72 65 20 2a | empty p|icture *|
|000048a0| 2f 0d 09 09 53 65 74 50 | 6f 72 74 28 77 69 6e 64 |/...SetP|ort(wind|
|000048b0| 29 3b 0d 09 09 49 6e 76 | 61 6c 52 65 63 74 28 26 |);...Inv|alRect(&|
|000048c0| 77 69 6e 64 2d 3e 70 6f | 72 74 52 65 63 74 29 3b |wind->po|rtRect);|
|000048d0| 0d 09 7d 0d 7d 0d 0d 2f | 2a 20 43 61 6c 6c 65 64 |..}.}../|* Called|
|000048e0| 20 77 68 65 6e 20 74 68 | 65 20 75 73 65 72 20 73 | when th|e user s|
|000048f0| 65 6c 65 63 74 73 20 22 | 43 6f 70 79 22 20 66 72 |elects "|Copy" fr|
|00004900| 6f 6d 20 74 68 65 20 45 | 64 69 74 20 6d 65 6e 75 |om the E|dit menu|
|00004910| 2e 20 2a 2f 0d 4f 53 45 | 72 72 20 41 70 70 43 6f |. */.OSE|rr AppCo|
|00004920| 70 79 28 76 6f 69 64 29 | 0d 7b 0d 09 50 69 63 48 |py(void)|.{..PicH|
|00004930| 61 6e 64 6c 65 09 09 70 | 69 63 74 3b 0d 09 44 6f |andle..p|ict;..Do|
|00004940| 63 75 6d 65 6e 74 50 65 | 65 6b 09 64 6f 63 3b 0d |cumentPe|ek.doc;.|
|00004950| 09 6c 6f 6e 67 09 09 09 | 6c 65 6e 67 74 68 3b 0d |.long...|length;.|
|00004960| 09 4f 53 45 72 72 09 09 | 09 65 72 72 20 3d 20 2d |.OSErr..|.err = -|
|00004970| 31 3b 0d 09 57 69 6e 64 | 6f 77 50 74 72 09 09 77 |1;..Wind|owPtr..w|
|00004980| 69 6e 64 3b 0d 09 0d 09 | 2f 2a 20 44 6f 20 6e 6f |ind;....|/* Do no|
|00004990| 74 68 69 6e 67 20 69 66 | 20 74 68 65 20 66 72 6f |thing if| the fro|
|000049a0| 6e 74 20 77 69 6e 64 6f | 77 20 69 73 6e 27 74 20 |nt windo|w isn't |
|000049b0| 6f 75 72 73 20 2a 2f 0d | 09 77 69 6e 64 20 3d 20 |ours */.|.wind = |
|000049c0| 46 72 6f 6e 74 57 69 6e | 64 6f 77 28 29 3b 0d 09 |FrontWin|dow();..|
|000049d0| 69 66 28 49 73 41 70 70 | 57 69 6e 64 6f 77 28 77 |if(IsApp|Window(w|
|000049e0| 69 6e 64 29 20 3d 3d 20 | 66 61 6c 73 65 29 0d 09 |ind) == |false)..|
|000049f0| 09 72 65 74 75 72 6e 20 | 6e 6f 45 72 72 3b 0d 09 |.return |noErr;..|
|00004a00| 0d 09 2f 2a 20 47 65 74 | 20 74 68 65 20 77 69 6e |../* Get| the win|
|00004a10| 64 6f 77 20 77 65 20 61 | 72 65 20 63 6f 70 79 69 |dow we a|re copyi|
|00004a20| 6e 67 20 66 72 6f 6d 2c | 20 61 6e 64 20 69 74 73 |ng from,| and its|
|00004a30| 20 6f 66 66 20 77 6f 72 | 6c 64 20 2a 2f 0d 09 64 | off wor|ld */..d|
|00004a40| 6f 63 20 3d 20 28 44 6f | 63 75 6d 65 6e 74 50 65 |oc = (Do|cumentPe|
|00004a50| 65 6b 29 77 69 6e 64 3b | 0d 0d 09 69 66 28 64 6f |ek)wind;|...if(do|
|00004a60| 63 2d 3e 77 6f 72 6c 64 | 20 21 3d 20 6e 69 6c 29 |c->world| != nil)|
|00004a70| 0d 09 7b 0d 09 09 65 72 | 72 20 3d 20 5a 65 72 6f |..{...er|r = Zero|
|00004a80| 53 63 72 61 70 28 29 3b | 0d 09 09 69 66 28 65 72 |Scrap();|...if(er|
|00004a90| 72 20 3d 3d 20 6e 6f 45 | 72 72 29 0d 09 09 7b 0d |r == noE|rr)...{.|
|00004aa0| 09 09 09 65 72 72 20 3d | 20 2d 31 3b 20 2f 2a 20 |...err =| -1; /* |
|00004ab0| 72 65 73 65 74 20 65 72 | 72 6f 72 20 2a 2f 0d 09 |reset er|ror */..|
|00004ac0| 09 09 2f 2a 20 43 6f 6e | 76 65 72 74 20 47 57 6f |../* Con|vert GWo|
|00004ad0| 72 6c 64 20 74 6f 20 61 | 20 70 69 63 74 20 2a 2f |rld to a| pict */|
|00004ae0| 0d 09 09 09 70 69 63 74 | 20 3d 20 57 6f 72 6c 64 |....pict| = World|
|00004af0| 54 6f 50 69 63 74 28 64 | 6f 63 2d 3e 77 6f 72 6c |ToPict(d|oc->worl|
|00004b00| 64 29 3b 0d 09 09 09 69 | 66 28 70 69 63 74 20 21 |d);....i|f(pict !|
|00004b10| 3d 20 6e 69 6c 29 0d 09 | 09 09 7b 0d 09 09 09 09 |= nil)..|..{.....|
|00004b20| 2f 2a 20 46 69 67 75 72 | 65 20 6f 75 74 20 68 6f |/* Figur|e out ho|
|00004b30| 77 20 62 69 67 20 74 68 | 65 20 70 69 63 74 20 69 |w big th|e pict i|
|00004b40| 73 20 2a 2f 0d 09 09 09 | 09 6c 65 6e 67 74 68 20 |s */....|.length |
|00004b50| 3d 20 47 65 74 48 61 6e | 64 6c 65 53 69 7a 65 28 |= GetHan|dleSize(|
|00004b60| 70 69 63 74 29 3b 0d 09 | 09 09 09 48 4c 6f 63 6b |pict);..|...HLock|
|00004b70| 28 70 69 63 74 29 3b 0d | 09 09 09 09 0d 09 09 09 |(pict);.|........|
|00004b80| 09 2f 2a 20 50 75 74 20 | 69 74 20 69 6e 20 74 68 |./* Put |it in th|
|00004b90| 65 20 63 6c 69 70 62 6f | 61 72 64 20 2a 2f 0d 09 |e clipbo|ard */..|
|00004ba0| 09 09 09 65 72 72 20 3d | 20 50 75 74 53 63 72 61 |...err =| PutScra|
|00004bb0| 70 28 6c 65 6e 67 74 68 | 2c 20 27 50 49 43 54 27 |p(length|, 'PICT'|
|00004bc0| 2c 20 2a 70 69 63 74 29 | 3b 0d 09 09 09 09 48 55 |, *pict)|;.....HU|
|00004bd0| 6e 6c 6f 63 6b 28 70 69 | 63 74 29 3b 0d 09 09 09 |nlock(pi|ct);....|
|00004be0| 09 4b 69 6c 6c 50 69 63 | 74 75 72 65 28 70 69 63 |.KillPic|ture(pic|
|00004bf0| 74 29 3b 0d 09 09 09 7d | 0d 09 09 09 65 6c 73 65 |t);....}|....else|
|00004c00| 0d 09 09 09 09 65 72 72 | 20 3d 20 6d 65 6d 46 75 |.....err| = memFu|
|00004c10| 6c 6c 45 72 72 3b 0d 09 | 09 7d 0d 09 7d 0d 09 69 |llErr;..|.}..}..i|
|00004c20| 66 28 65 72 72 20 21 3d | 20 6e 6f 45 72 72 29 0d |f(err !=| noErr).|
|00004c30| 09 7b 0d 09 09 69 66 28 | 65 72 72 20 3d 3d 20 6d |.{...if(|err == m|
|00004c40| 65 6d 46 75 6c 6c 45 72 | 72 29 0d 09 09 09 44 6f |emFullEr|r)....Do|
|00004c50| 45 72 72 6f 72 41 6c 65 | 72 74 28 6b 4e 6f 4d 65 |ErrorAle|rt(kNoMe|
|00004c60| 6d 53 74 72 2c 20 30 29 | 3b 0d 09 09 65 6c 73 65 |mStr, 0)|;...else|
|00004c70| 0d 09 09 09 44 6f 45 72 | 72 6f 72 41 6c 65 72 74 |....DoEr|rorAlert|
|00004c80| 28 6b 47 65 6e 65 72 69 | 63 45 72 72 6f 72 53 74 |(kGeneri|cErrorSt|
|00004c90| 72 2c 20 65 72 72 29 3b | 0d 09 7d 0d 09 72 65 74 |r, err);|..}..ret|
|00004ca0| 75 72 6e 20 65 72 72 3b | 0d 7d 09 09 09 0d 09 09 |urn err;|.}......|
|00004cb0| 09 0d 2f 2a 20 43 61 6c | 6c 65 64 20 77 68 65 6e |../* Cal|led when|
|00004cc0| 20 74 68 65 20 75 73 65 | 72 20 73 65 6c 65 63 74 | the use|r select|
|00004cd0| 73 20 22 50 61 73 74 65 | 22 20 66 72 6f 6d 20 74 |s "Paste|" from t|
|00004ce0| 68 65 20 45 64 69 74 20 | 6d 65 6e 75 2e 20 2a 2f |he Edit |menu. */|
|00004cf0| 0d 76 6f 69 64 20 41 70 | 70 50 61 73 74 65 28 76 |.void Ap|pPaste(v|
|00004d00| 6f 69 64 29 0d 7b 0d 09 | 50 69 63 48 61 6e 64 6c |oid).{..|PicHandl|
|00004d10| 65 09 09 70 69 63 74 3b | 0d 09 52 65 63 74 09 09 |e..pict;|..Rect..|
|00004d20| 09 66 72 61 6d 65 3b 0d | 09 44 6f 63 75 6d 65 6e |.frame;.|.Documen|
|00004d30| 74 50 65 65 6b 09 64 6f | 63 3b 0d 09 6c 6f 6e 67 |tPeek.do|c;..long|
|00004d40| 09 09 09 6c 65 6e 67 74 | 68 2c 20 64 75 6d 3b 0d |...lengt|h, dum;.|
|00004d50| 09 57 69 6e 64 6f 77 50 | 74 72 09 09 77 69 6e 64 |.WindowP|tr..wind|
|00004d60| 3b 0d 09 43 47 72 61 66 | 50 74 72 09 09 6f 6c 64 |;..CGraf|Ptr..old|
|00004d70| 70 6f 72 74 3b 0d 09 47 | 44 48 61 6e 64 6c 65 09 |port;..G|DHandle.|
|00004d80| 09 6f 6c 64 64 65 76 3b | 0d 09 0d 09 2f 2a 20 44 |.olddev;|..../* D|
|00004d90| 6f 20 6e 6f 74 68 69 6e | 67 20 69 66 20 74 68 65 |o nothin|g if the|
|00004da0| 20 66 72 6f 6e 74 20 77 | 69 6e 64 6f 77 20 69 73 | front w|indow is|
|00004db0| 6e 27 74 20 6f 75 72 73 | 20 2a 2f 0d 09 77 69 6e |n't ours| */..win|
|00004dc0| 64 20 3d 20 46 72 6f 6e | 74 57 69 6e 64 6f 77 28 |d = Fron|tWindow(|
|00004dd0| 29 3b 0d 09 69 66 28 49 | 73 41 70 70 57 69 6e 64 |);..if(I|sAppWind|
|00004de0| 6f 77 28 77 69 6e 64 29 | 20 3d 3d 20 66 61 6c 73 |ow(wind)| == fals|
|00004df0| 65 29 0d 09 09 72 65 74 | 75 72 6e 3b 0d 09 0d 09 |e)...ret|urn;....|
|00004e00| 2f 2a 20 53 61 76 65 20 | 74 68 65 20 63 75 72 72 |/* Save |the curr|
|00004e10| 65 6e 74 20 70 6f 72 74 | 20 61 6e 64 20 64 65 76 |ent port| and dev|
|00004e20| 69 63 65 20 2a 2f 09 0d | 09 47 65 74 47 57 6f 72 |ice */..|.GetGWor|
|00004e30| 6c 64 28 26 6f 6c 64 70 | 6f 72 74 2c 20 26 6f 6c |ld(&oldp|ort, &ol|
|00004e40| 64 64 65 76 29 3b 0d 09 | 0d 09 2f 2a 20 4d 61 6b |ddev);..|../* Mak|
|00004e50| 65 20 61 20 73 6d 61 6c | 6c 20 68 61 6e 64 6c 65 |e a smal|l handle|
|00004e60| 20 74 6f 20 68 6f 6c 64 | 20 74 68 65 20 70 69 63 | to hold| the pic|
|00004e70| 74 20 2a 2f 0d 09 70 69 | 63 74 20 3d 20 28 50 69 |t */..pi|ct = (Pi|
|00004e80| 63 48 61 6e 64 6c 65 29 | 4e 65 77 48 61 6e 64 6c |cHandle)|NewHandl|
|00004e90| 65 28 38 4c 29 3b 0d 09 | 69 66 28 70 69 63 74 20 |e(8L);..|if(pict |
|00004ea0| 21 3d 20 6e 69 6c 29 0d | 09 7b 0d 09 09 2f 2a 20 |!= nil).|.{.../* |
|00004eb0| 47 65 74 20 74 68 65 20 | 70 69 63 74 20 66 72 6f |Get the |pict fro|
|00004ec0| 6d 20 74 68 65 20 63 6c | 69 70 62 6f 61 72 64 20 |m the cl|ipboard |
|00004ed0| 2a 2f 0d 09 09 6c 65 6e | 67 74 68 20 3d 20 47 65 |*/...len|gth = Ge|
|00004ee0| 74 53 63 72 61 70 28 70 | 69 63 74 2c 20 27 50 49 |tScrap(p|ict, 'PI|
|00004ef0| 43 54 27 2c 20 26 64 75 | 6d 29 3b 0d 09 09 69 66 |CT', &du|m);...if|
|00004f00| 28 6c 65 6e 67 74 68 20 | 3e 20 30 29 20 2f 2a 20 |(length |> 0) /* |
|00004f10| 67 6f 74 20 73 6f 6d 65 | 74 68 69 6e 67 20 2a 2f |got some|thing */|
|00004f20| 0d 09 09 7b 0d 09 09 09 | 2f 2a 20 47 65 74 20 74 |...{....|/* Get t|
|00004f30| 68 65 20 64 6f 63 20 77 | 65 20 61 72 65 20 70 61 |he doc w|e are pa|
|00004f40| 73 74 69 6e 67 20 69 6e | 74 6f 20 2a 2f 0d 09 09 |sting in|to */...|
|00004f50| 09 64 6f 63 20 3d 20 28 | 44 6f 63 75 6d 65 6e 74 |.doc = (|Document|
|00004f60| 50 65 65 6b 29 77 69 6e | 64 3b 0d 09 09 09 0d 09 |Peek)win|d;......|
|00004f70| 09 09 2f 2a 20 41 6c 6c | 6f 77 20 61 6e 20 75 6e |../* All|ow an un|
|00004f80| 64 6f 20 2a 2f 0d 09 09 | 09 53 65 74 55 70 46 6f |do */...|.SetUpFo|
|00004f90| 72 55 6e 64 6f 28 77 69 | 6e 64 29 3b 0d 09 09 09 |rUndo(wi|nd);....|
|00004fa0| 0d 09 09 09 2f 2a 20 44 | 72 61 77 20 74 68 65 20 |..../* D|raw the |
|00004fb0| 70 69 63 74 75 72 65 20 | 2a 2f 0d 09 09 09 53 65 |picture |*/....Se|
|00004fc0| 74 47 57 6f 72 6c 64 28 | 64 6f 63 2d 3e 77 6f 72 |tGWorld(|doc->wor|
|00004fd0| 6c 64 2c 20 6e 69 6c 29 | 3b 0d 09 09 09 66 72 61 |ld, nil)|;....fra|
|00004fe0| 6d 65 20 3d 20 28 2a 2a | 70 69 63 74 29 2e 70 69 |me = (**|pict).pi|
|00004ff0| 63 46 72 61 6d 65 3b 0d | 09 09 09 44 72 61 77 50 |cFrame;.|...DrawP|
|00005000| 69 63 74 75 72 65 28 70 | 69 63 74 2c 20 26 66 72 |icture(p|ict, &fr|
|00005010| 61 6d 65 29 3b 0d 0d 09 | 09 09 2f 2a 20 53 65 74 |ame);...|../* Set|
|00005020| 20 74 68 65 20 64 69 72 | 74 79 20 66 6c 61 67 20 | the dir|ty flag |
|00005030| 66 6f 72 20 74 68 65 20 | 77 69 6e 64 6f 77 20 77 |for the |window w|
|00005040| 65 20 70 61 73 74 65 64 | 20 69 6e 74 6f 20 74 6f |e pasted| into to|
|00005050| 20 74 72 75 65 2c 20 61 | 6e 64 20 0d 09 09 09 49 | true, a|nd ....I|
|00005060| 6e 76 61 6c 20 74 68 65 | 20 70 6f 72 74 20 72 65 |nval the| port re|
|00005070| 63 74 20 73 6f 20 69 74 | 20 69 73 20 75 70 64 61 |ct so it| is upda|
|00005080| 74 65 64 20 2a 2f 0d 09 | 09 09 64 6f 63 2d 3e 64 |ted */..|..doc->d|
|00005090| 69 72 74 79 20 3d 20 74 | 72 75 65 3b 0d 09 09 09 |irty = t|rue;....|
|000050a0| 53 65 74 47 57 6f 72 6c | 64 28 77 69 6e 64 2c 20 |SetGWorl|d(wind, |
|000050b0| 6f 6c 64 64 65 76 29 3b | 0d 09 09 09 49 6e 76 61 |olddev);|....Inva|
|000050c0| 6c 52 65 63 74 28 26 77 | 69 6e 64 2d 3e 70 6f 72 |lRect(&w|ind->por|
|000050d0| 74 52 65 63 74 29 3b 0d | 09 09 7d 0d 09 09 65 6c |tRect);.|..}...el|
|000050e0| 73 65 0d 09 09 09 44 6f | 45 72 72 6f 72 41 6c 65 |se....Do|ErrorAle|
|000050f0| 72 74 28 6b 47 65 6e 65 | 72 69 63 45 72 72 6f 72 |rt(kGene|ricError|
|00005100| 53 74 72 2c 20 30 29 3b | 20 2f 2a 20 4e 6f 20 70 |Str, 0);| /* No p|
|00005110| 69 63 74 20 69 6e 20 63 | 6c 69 70 2c 20 6f 72 20 |ict in c|lip, or |
|00005120| 63 6f 75 6c 64 6e 27 74 | 20 67 65 74 20 69 74 20 |couldn't| get it |
|00005130| 2a 2f 0d 09 09 44 69 73 | 70 6f 73 48 61 6e 64 6c |*/...Dis|posHandl|
|00005140| 65 28 28 48 61 6e 64 6c | 65 29 70 69 63 74 29 3b |e((Handl|e)pict);|
|00005150| 0d 09 7d 0d 09 65 6c 73 | 65 0d 09 09 44 6f 45 72 |..}..els|e...DoEr|
|00005160| 72 6f 72 41 6c 65 72 74 | 28 6b 4e 6f 4d 65 6d 53 |rorAlert|(kNoMemS|
|00005170| 74 72 2c 20 30 29 3b 0d | 7d 0d 0d 2f 2a 20 43 61 |tr, 0);.|}../* Ca|
|00005180| 6c 6c 65 64 20 77 68 65 | 6e 20 74 68 65 20 75 73 |lled whe|n the us|
|00005190| 65 72 20 73 65 6c 65 63 | 74 73 20 22 43 6c 65 61 |er selec|ts "Clea|
|000051a0| 72 22 20 66 72 6f 6d 20 | 74 68 65 20 45 64 69 74 |r" from |the Edit|
|000051b0| 20 6d 65 6e 75 2e 20 2a | 2f 0d 76 6f 69 64 20 41 | menu. *|/.void A|
|000051c0| 70 70 43 6c 65 61 72 28 | 76 6f 69 64 29 0d 7b 0d |ppClear(|void).{.|
|000051d0| 09 44 6f 63 75 6d 65 6e | 74 50 65 65 6b 09 64 6f |.Documen|tPeek.do|
|000051e0| 63 3b 0d 09 57 69 6e 64 | 6f 77 50 74 72 09 09 77 |c;..Wind|owPtr..w|
|000051f0| 69 6e 64 3b 0d 09 0d 09 | 2f 2a 20 44 6f 20 6e 6f |ind;....|/* Do no|
|00005200| 74 68 69 6e 67 20 69 66 | 20 74 68 65 20 66 72 6f |thing if| the fro|
|00005210| 6e 74 20 77 69 6e 64 6f | 77 20 69 73 6e 27 74 20 |nt windo|w isn't |
|00005220| 6f 75 72 73 20 2a 2f 0d | 09 77 69 6e 64 20 3d 20 |ours */.|.wind = |
|00005230| 46 72 6f 6e 74 57 69 6e | 64 6f 77 28 29 3b 0d 09 |FrontWin|dow();..|
|00005240| 69 66 28 49 73 41 70 70 | 57 69 6e 64 6f 77 28 77 |if(IsApp|Window(w|
|00005250| 69 6e 64 29 20 3d 3d 20 | 66 61 6c 73 65 29 0d 09 |ind) == |false)..|
|00005260| 09 72 65 74 75 72 6e 3b | 0d 09 09 0d 09 64 6f 63 |.return;|.....doc|
|00005270| 20 3d 20 28 44 6f 63 75 | 6d 65 6e 74 50 65 65 6b | = (Docu|mentPeek|
|00005280| 29 77 69 6e 64 3b 0d 09 | 0d 09 2f 2a 20 41 6c 6c |)wind;..|../* All|
|00005290| 6f 77 20 61 6e 20 75 6e | 64 6f 20 2a 2f 0d 09 53 |ow an un|do */..S|
|000052a0| 65 74 55 70 46 6f 72 55 | 6e 64 6f 28 77 69 6e 64 |etUpForU|ndo(wind|
|000052b0| 29 3b 0d 0d 09 2f 2a 20 | 63 6c 65 61 72 20 74 68 |);.../* |clear th|
|000052c0| 65 20 6f 66 66 20 77 6f | 72 6c 64 20 61 6e 64 20 |e off wo|rld and |
|000052d0| 72 65 71 75 65 73 74 20 | 61 20 77 69 6e 64 6f 77 |request |a window|
|000052e0| 20 75 70 64 61 74 65 20 | 2a 2f 0d 09 69 66 28 64 | update |*/..if(d|
|000052f0| 6f 63 2d 3e 77 6f 72 6c | 64 20 21 3d 20 6e 69 6c |oc->worl|d != nil|
|00005300| 29 0d 09 09 45 72 61 73 | 65 4f 66 66 28 64 6f 63 |)...Eras|eOff(doc|
|00005310| 2d 3e 77 6f 72 6c 64 29 | 3b 0d 09 64 6f 63 2d 3e |->world)|;..doc->|
|00005320| 64 69 72 74 79 20 3d 20 | 66 61 6c 73 65 3b 20 20 |dirty = |false; |
|00005330| 2f 2a 20 61 73 73 75 6d | 65 20 6e 6f 20 6f 6e 65 |/* assum|e no one|
|00005340| 20 77 61 6e 74 73 20 74 | 6f 20 73 61 76 65 20 61 | wants t|o save a|
|00005350| 6e 20 65 6d 70 74 79 20 | 70 69 63 74 75 72 65 20 |n empty |picture |
|00005360| 2a 2f 0d 09 53 65 74 50 | 6f 72 74 28 77 69 6e 64 |*/..SetP|ort(wind|
|00005370| 29 3b 0d 09 49 6e 76 61 | 6c 52 65 63 74 28 26 77 |);..Inva|lRect(&w|
|00005380| 69 6e 64 2d 3e 70 6f 72 | 74 52 65 63 74 29 3b 0d |ind->por|tRect);.|
|00005390| 7d 0d 0d 2f 2a 20 09 43 | 61 6c 6c 65 64 20 77 68 |}../* .C|alled wh|
|000053a0| 65 6e 20 74 68 65 20 75 | 73 65 72 20 63 68 6f 6f |en the u|ser choo|
|000053b0| 73 65 73 20 22 51 75 69 | 74 22 20 66 72 6f 6d 20 |ses "Qui|t" from |
|000053c0| 74 68 65 20 46 69 6c 65 | 20 6d 65 6e 75 2e 20 49 |the File| menu. I|
|000053d0| 66 20 74 68 65 20 75 73 | 65 72 20 63 61 6e 63 65 |f the us|er cance|
|000053e0| 6c 73 0d 74 68 65 20 73 | 61 76 65 20 69 74 20 72 |ls.the s|ave it r|
|000053f0| 65 74 75 72 6e 73 20 66 | 61 6c 73 65 2c 20 6f 74 |eturns f|alse, ot|
|00005400| 68 65 72 77 69 73 65 20 | 69 74 20 72 65 74 75 72 |herwise |it retur|
|00005410| 6e 73 20 74 72 75 65 20 | 61 6e 64 20 74 68 65 20 |ns true |and the |
|00005420| 73 68 65 6c 6c 20 71 75 | 69 74 73 20 2a 2f 0d 42 |shell qu|its */.B|
|00005430| 6f 6f 6c 65 61 6e 20 41 | 70 70 51 75 69 74 28 76 |oolean A|ppQuit(v|
|00005440| 6f 69 64 29 0d 7b 0d 09 | 2f 2a 20 72 65 74 75 72 |oid).{..|/* retur|
|00005450| 6e 73 20 66 61 6c 73 65 | 20 69 66 20 74 68 65 20 |ns false| if the |
|00005460| 75 73 65 72 20 63 61 6e | 63 65 6c 73 20 74 68 65 |user can|cels the|
|00005470| 20 73 61 76 65 20 61 74 | 20 61 6e 79 20 70 6f 69 | save at| any poi|
|00005480| 6e 74 2c 20 6f 72 20 69 | 66 20 74 68 65 72 65 20 |nt, or i|f there |
|00005490| 69 73 20 61 6e 20 65 72 | 72 6f 72 0d 09 73 61 76 |is an er|ror..sav|
|000054a0| 69 6e 67 20 2a 2f 0d 09 | 72 65 74 75 72 6e 20 53 |ing */..|return S|
|000054b0| 61 76 65 43 75 72 72 65 | 6e 74 44 6f 63 73 28 29 |aveCurre|ntDocs()|
|000054c0| 3b 0d 7d 0d 0d 2f 2a 20 | 43 61 6c 6c 65 64 20 77 |;.}../* |Called w|
|000054d0| 68 65 6e 20 74 68 65 20 | 73 68 65 6c 6c 20 69 73 |hen the |shell is|
|000054e0| 20 61 62 6f 75 74 20 74 | 6f 20 71 75 69 74 2c 20 | about t|o quit, |
|000054f0| 4a 75 73 74 20 64 65 61 | 6c 6c 6f 63 61 74 65 73 |Just dea|llocates|
|00005500| 20 6d 65 6d 6f 72 79 2e | 20 2a 2f 0d 76 6f 69 64 | memory.| */.void|
|00005510| 20 41 70 70 43 6c 65 61 | 6e 55 70 28 76 6f 69 64 | AppClea|nUp(void|
|00005520| 29 0d 7b 0d 09 2f 2a 20 | 55 6e 6c 6f 61 64 20 74 |).{../* |Unload t|
|00005530| 68 65 20 63 75 72 72 65 | 6e 74 20 62 72 75 73 68 |he curre|nt brush|
|00005540| 20 2a 2f 0d 09 69 66 28 | 67 43 75 72 72 65 6e 74 | */..if(|gCurrent|
|00005550| 42 72 75 73 68 48 61 6e | 64 6c 65 20 21 3d 20 6e |BrushHan|dle != n|
|00005560| 69 6c 29 0d 09 7b 0d 09 | 09 43 61 6c 6c 42 72 75 |il)..{..|.CallBru|
|00005570| 73 68 28 6b 53 74 6f 70 | 42 72 75 73 68 2c 20 26 |sh(kStop|Brush, &|
|00005580| 67 42 72 75 73 68 53 74 | 75 66 66 2c 20 67 43 75 |gBrushSt|uff, gCu|
|00005590| 72 72 65 6e 74 42 72 75 | 73 68 48 61 6e 64 6c 65 |rrentBru|shHandle|
|000055a0| 29 3b 0d 09 09 52 65 6c | 65 61 73 65 52 65 73 6f |);...Rel|easeReso|
|000055b0| 75 72 63 65 28 67 43 75 | 72 72 65 6e 74 42 72 75 |urce(gCu|rrentBru|
|000055c0| 73 68 48 61 6e 64 6c 65 | 29 3b 0d 09 09 67 42 72 |shHandle|);...gBr|
|000055d0| 75 73 68 53 74 75 66 66 | 2e 73 74 6f 72 61 67 65 |ushStuff|.storage|
|000055e0| 20 3d 20 28 6c 6f 6e 67 | 29 6e 69 6c 3b 0d 09 7d | = (long|)nil;..}|
|000055f0| 0d 09 0d 09 2f 2a 20 4b | 69 6c 6c 20 74 68 65 20 |..../* K|ill the |
|00005600| 47 57 6f 72 6c 64 73 20 | 2a 2f 0d 09 4b 69 6c 6c |GWorlds |*/..Kill|
|00005610| 47 6c 6f 62 61 6c 47 57 | 6f 72 6c 64 73 28 29 3b |GlobalGW|orlds();|
|00005620| 0d 09 0d 09 2f 2a 20 4b | 69 6c 6c 20 74 68 65 20 |..../* K|ill the |
|00005630| 70 72 69 6e 74 20 72 65 | 63 6f 72 64 2c 20 69 66 |print re|cord, if|
|00005640| 20 74 68 65 72 65 20 69 | 73 20 6f 6e 65 20 2a 2f | there i|s one */|
|00005650| 0d 09 69 66 28 67 50 72 | 69 6e 74 52 65 63 48 61 |..if(gPr|intRecHa|
|00005660| 6e 64 6c 65 20 21 3d 20 | 6e 69 6c 29 0d 09 09 44 |ndle != |nil)...D|
|00005670| 69 73 70 6f 73 48 61 6e | 64 6c 65 28 67 50 72 69 |isposHan|dle(gPri|
|00005680| 6e 74 52 65 63 48 61 6e | 64 6c 65 29 3b 0d 09 09 |ntRecHan|dle);...|
|00005690| 0d 09 2f 2a 20 43 6c 6f | 73 65 20 74 68 65 20 77 |../* Clo|se the w|
|000056a0| 69 6e 64 6f 77 73 2c 20 | 77 68 69 63 68 20 61 6c |indows, |which al|
|000056b0| 73 6f 20 6b 69 6c 6c 73 | 20 74 68 65 20 73 63 72 |so kills| the scr|
|000056c0| 6f 6c 6c 42 61 72 73 20 | 2a 2f 0d 09 69 66 28 67 |ollBars |*/..if(g|
|000056d0| 53 72 63 57 69 6e 64 50 | 74 72 20 21 3d 20 6e 69 |SrcWindP|tr != ni|
|000056e0| 6c 29 0d 09 09 43 6c 6f | 73 65 57 69 6e 64 6f 77 |l)...Clo|seWindow|
|000056f0| 28 67 53 72 63 57 69 6e | 64 50 74 72 29 3b 0d 09 |(gSrcWin|dPtr);..|
|00005700| 69 66 28 67 44 73 74 57 | 69 6e 64 50 74 72 20 21 |if(gDstW|indPtr !|
|00005710| 3d 20 6e 69 6c 29 0d 09 | 09 43 6c 6f 73 65 57 69 |= nil)..|.CloseWi|
|00005720| 6e 64 6f 77 28 67 44 73 | 74 57 69 6e 64 50 74 72 |ndow(gDs|tWindPtr|
|00005730| 29 3b 0d 7d 0d 0d 0d 00 | 00 00 00 00 00 00 00 00 |);.}....|........|
|00005740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005780| 00 00 01 00 00 00 03 2a | 00 00 02 2a 00 00 00 46 |.......*|...*...F|
|00005790| 2f 0d 09 09 67 42 72 75 | 73 68 53 74 75 66 66 2e |/...gBru|shStuff.|
|000057a0| 73 74 6f 72 61 67 65 20 | 3d 20 28 6c 6f 6e 67 29 |storage |= (long)|
|000057b0| 0a 50 61 69 6e 74 41 70 | 70 2e 63 00 02 00 00 00 |.PaintAp|p.c.....|
|000057c0| 54 45 58 54 4b 41 48 4c | 01 00 00 34 01 2d 00 00 |TEXTKAHL|...4.-..|
|000057d0| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 34 01 2d |..TEXTKA|HL...4.-|
|000057e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057f0| 00 00 a5 9c 35 40 00 00 | 56 b7 00 00 03 70 69 64 |....5@..|V....pid|
|00005800| 29 3b 0d 0d 2f 2a 20 45 | 76 65 6e 74 73 20 2a 2f |);../* E|vents */|
|00005810| 0d 76 6f 69 64 20 09 44 | 6f 41 70 70 55 70 64 61 |.void .D|oAppUpda|
|00005820| 74 65 28 45 76 65 6e 74 | 52 65 63 6f 72 64 20 2a |te(Event|Record *|
|00005830| 45 76 65 6e 74 29 3b 0d | 76 6f 69 64 20 09 44 6f |Event);.|void .Do|
|00005840| 41 70 70 49 64 6c 65 28 | 45 76 65 6e 74 52 65 63 |AppIdle(|EventRec|
|00005850| 6f 72 64 20 2a 45 76 65 | 6e 74 29 3b 0d 76 6f 69 |ord *Eve|nt);.voi|
|00005860| 64 20 09 44 6f 41 70 70 | 43 6c 69 63 6b 28 50 6f |d .DoApp|Click(Po|
|00005870| 69 6e 74 20 74 68 65 50 | 74 2c 20 57 69 6e 64 6f |int theP|t, Windo|
|00005880| 00 00 00 0a 00 00 16 c4 | 00 c2 00 00 00 00 00 00 |........|........|
|00005890| 02 18 00 17 00 00 04 f7 | 00 00 04 fe 0d 00 00 00 |........|........|
|000058a0| 31 20 41 70 70 49 6e 69 | 74 00 00 00 07 34 00 00 |1 AppIni|t....4..|
|000058b0| 07 3f 11 00 00 00 32 20 | 41 70 70 41 63 74 69 76 |.?....2 |AppActiv|
|000058c0| 61 74 65 00 00 00 09 e1 | 00 00 09 ea 0f 00 00 00 |ate.....|........|
|000058d0| 33 20 41 70 70 55 70 64 | 61 74 65 00 00 00 0c 19 |3 AppUpd|ate.....|
|000058e0| 00 00 0c 20 0d 00 00 00 | 34 20 41 70 70 49 64 6c |... ....|4 AppIdl|
|000058f0| 65 00 00 00 10 74 00 00 | 10 7c 0d 00 00 00 35 20 |e....t..|.|....5 |
|00005900| 41 70 70 43 6c 69 63 6b | 00 00 18 bd 00 00 18 ca |AppClick|........|
|00005910| 13 00 00 00 36 20 41 70 | 70 47 72 6f 77 57 69 6e |....6 Ap|pGrowWin|
|00005920| 64 6f 77 00 00 00 21 aa | 00 00 21 b7 13 00 00 00 |dow...!.|..!.....|
|00005930| 37 20 41 70 70 5a 6f 6f | 6d 57 69 6e 64 6f 77 00 |7 AppZoo|mWindow.|
|00005940| 00 00 26 07 00 00 26 15 | 13 00 00 00 38 20 41 70 |..&...&.|....8 Ap|
|00005950| 70 41 64 6a 75 73 74 4d | 65 6e 75 73 00 00 2d 95 |pAdjustM|enus..-.|
|00005960| 00 00 2d 9c 0d 00 00 00 | 39 20 41 70 70 4d 65 6e |..-.....|9 AppMen|
|00005970| 75 00 00 00 2e 91 00 00 | 2e 91 0b 00 00 31 30 20 |u.......|.....10 |
|00005980| 41 70 70 4e 65 77 00 00 | 2f 3f 00 00 2f 46 0d 00 |AppNew..|/?../F..|
|00005990| 00 31 31 20 41 70 70 4f | 70 65 6e 00 00 00 33 09 |.11 AppO|pen...3.|
|000059a0| 00 00 33 11 0d 00 00 31 | 32 20 41 70 70 43 6c 6f |..3....1|2 AppClo|
|000059b0| 73 65 00 00 36 61 00 00 | 36 68 0d 00 00 31 33 20 |se..6a..|6h...13 |
|000059c0| 41 70 70 53 61 76 65 00 | 00 00 3b 43 00 00 3b 4c |AppSave.|..;C..;L|
|000059d0| 0f 00 00 31 34 20 41 70 | 70 53 61 76 65 41 73 00 |...14 Ap|pSaveAs.|
|000059e0| 00 00 40 c4 00 00 40 d0 | 11 00 00 31 35 20 41 70 |..@...@.|...15 Ap|
|000059f0| 70 50 61 67 65 53 65 74 | 75 70 00 00 42 3f 00 00 |pPageSet|up..B?..|
|00005a00| 42 47 0d 00 00 31 36 20 | 41 70 70 50 72 69 6e 74 |BG...16 |AppPrint|
|00005a10| 00 00 43 89 00 00 43 90 | 0d 00 00 31 37 20 41 70 |..C...C.|...17 Ap|
|00005a20| 70 55 6e 64 6f 00 00 00 | 46 20 00 00 46 26 0b 00 |pUndo...|F ..F&..|
|00005a30| 00 31 38 20 41 70 70 43 | 75 74 00 00 48 9b 00 00 |.18 AppC|ut..H...|
|00005a40| 48 a2 0d 00 00 31 39 20 | 41 70 70 43 6f 70 79 00 |H....19 |AppCopy.|
|00005a50| 00 00 4c 76 00 00 4c 7e | 0d 00 00 32 30 20 41 70 |..Lv..L~|...20 Ap|
|00005a60| 70 50 61 73 74 65 00 00 | 51 3f 00 00 51 47 0d 00 |pPaste..|Q?..QG..|
|00005a70| 00 32 31 20 41 70 70 43 | 6c 65 61 72 00 00 53 b7 |.21 AppC|lear..S.|
|00005a80| 00 00 53 be 0d 00 00 32 | 32 20 41 70 70 51 75 69 |..S....2|2 AppQui|
|00005a90| 74 00 00 00 54 91 00 00 | 54 9b 0f 00 00 32 33 20 |t...T...|T....23 |
|00005aa0| 41 70 70 43 6c 65 61 6e | 55 70 00 00 01 00 00 00 |AppClean|Up......|
|00005ab0| 03 2a 00 00 02 2a 00 00 | 00 46 00 52 72 f0 0c 7e |.*...*..|.F.Rr..~|
|00005ac0| 00 00 00 1c 00 46 00 01 | 42 4b 50 54 00 00 00 12 |.....F..|BKPT....|
|00005ad0| 4d 50 53 52 00 00 00 1e | 04 cd ff ff 00 00 00 00 |MPSR....|........|
|00005ae0| 00 00 00 00 03 ef ff ff | 00 00 00 0e 00 00 00 00 |........|........|
|00005af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+